Forum Moderators: phranque

Message Too Old, No Replies

RewriteCond for all urls inside a directory

works for /blog but not /blog/articles/article-name

         

mattypython

7:42 pm on Jan 9, 2006 (gmt 0)

10+ Year Member



Hi all,

I have a Ruby on Rails app that uses mod_rewrite to grab all incoming urls and I have to manually specify which directories to leave alone. I'm very new to this, so I've just been using their sample code of:

RewriteCond %{REQUEST_URI} ^/blog.*
RewriteRule .* - [L]

Now this code works if I only hit /blog, but as soon as I dig deeper like /blog/articles/article-name then my Rails app grabs it again.

I assume this is as simple as changing the RegExp on my RewriteCond but, like I said, I'm a total noob.

Thanks.

jdMorgan

1:13 am on Jan 10, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You may need to add

RewriteEngine on
RewriteOptions inherit

to the .htaccess files in the path to /blog/articles/article-name

Jim