Rewrite rules for subfolders

Posted by pg on Stack Overflow See other posts from Stack Overflow or by pg
Published on 2010-04-14T00:04:57Z Indexed on 2010/04/14 0:32 UTC
Read the original article Hit count: 705

Filed under:
|

This may seem like a silly question but I can't figure it out.

let's say I have a public_html folder with various folders like: Albatross, Blackbirds, Crows and Faqs.

I want to make it so that any traffic to Albatross/faqs.php, Blackbirds/faqs.php, Crows/faqs.php etc will see the file that is at faqs/faqs.php?bird=albatross or faqs/faqs.php?bird=crows or what have you.

If I go into the Albatross folder's .htaccess file I can do this

RewriteRule faqs.php$ /faqs/faqs.php?cat=albatross[QSA]

Which works fine, but I want to put something in the top level .htacces that works for all of them, so tried:

RewriteRule faqs.php$ /faqs/faqs.php?cat=albatross[QSA]

RewriteRule /(.*)/faqs.php$ /faqs/faqs.php?cat=$1  [QSA] 

and even

RewriteRule /albatross/faqs.php$ /faqs/faqs.php?cat=albatross  [QSA] 

and various others but nothing seems to work, when I go to http://www.birdsandwhatnot.com/albatross/faqs.php I see the same file the same way it's always been. Does the presence of an .htaccess file in the subfolder conflict with the higher up .htaccess file?

Am I missing something?

© Stack Overflow or respective owner

Related posts about rewriterule

Related posts about .htaccess