[drupal-support] Re: changing Drupal .htaccess files directive

Gunther Herzog storysmith at softhome.net
Wed Aug 31 22:38:38 UTC 2005


Hello Charlie,

Monday, August 29, 2005, 7:35:27 PM, you wrote:

CL> It was the rewrite directives:

CL>    RewriteCond %{REQUEST_FILENAME} !-f
CL>    RewriteCond %{REQUEST_FILENAME} !-d
CL>    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]


CL> Once they were commented out, phpsurveyor
CL> seemed to work fine. 'Course I need them for
CL> my Drupal site :)

CL> Note: once I was logged in, I could change the
CL> directives back and the phpsurveyor admin
CL> section continued to work. Seems strange.

Yes, it's definitely the rewrite directives. I
also certainly don't want to disable the rewrite,
as I've grown really fond of having slashes (/)
instead of query strings that the search engines
don't want to follow.

My site is at my document_root, and in the "main"
(document_root) .htaccess file, here is what I
added to bypass processing for sub-folders that
are non-Drupal...

=========[ start of .htaccess snippet]==========
<IfModule mod_rewrite.c>
  RewriteEngine on
        
  #stuff to let through (ignore)
  RewriteCond %{REQUEST_URI} "favicon.ico" [OR]
  RewriteCond %{REQUEST_URI} "/rss/" [OR]
  RewriteCond  %{REQUEST_URI} "/test/"
  RewriteRule (.*) $1 [L]
  
====================[ end ]=====================

For each folder you want to bypass, add an
RewriteCond line, and end all but the final
RewriteCond with [OR].

In my sample, I don't want Drupal URL processing
for any requests of the favicon.ico file, my
non-Drupal RSS feed engine contained in the /rss/
sub-folder, and any PHP testing I happen to be
doing in the /test/ folder.

The [L] in the rewrite rule tells it to stop there
and bypass the rest of the rewrite rules.

Hope this helps.

-- 
Best regards,
 Gunther                            mailto:storysmith at softhome.net




More information about the drupal-support mailing list