Can't believe I can't figure this out... can't find info in the forums...

I have Drupal installed at the root of my site, and I have clean URL's enabled, it all works great.

Except that I want to have one static, non-Drupal file in the root directory, i.e.:

http://www.mysite.com/onepage.html

How can I modify mod_rewrite so that this one file is not controlled by Drupal (giving me a "page not found" error?

Thanks

Comments

solarflare4hair’s picture

Put this in your .htaccess file between the RewriteBase line and the first RewriteCond line:

RewriteRule ^onepage.html$ onepage.html [L,QSA]

If you're curious about the workings of mod_rewrite check out http://httpd.apache.org/docs/mod/mod_rewrite.html.en#RewriteRule

Cheers

andynyc’s picture

just got your post after I submitted my solution...

I had read the docs you referred to, the Drupal forums, and the Apache book I have, couldn't find an example. I had been trying using the dash with no success:

RewriteRule ^onepage.html$ - [L,QSA]

Still not sure why it didn't work, I thought the dash meant not to redirect.

Thanks for helping out!

andynyc’s picture

adding the following line to htaccess worked:

RewriteCond %{REQUEST_FILENAME} !^.*onepage\.html$

just add it right under the two existing RewriteCond lines