views:

136

answers:

1

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?

+1  A: 

A small correction should do the trick

RewriteEngine on

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

"/" is not being passed to parser.

Hope it helps

Michael
This is what I was going to post, except I usually go with [QSA,L] to make sure no other RewriteRules down the line cause trouble.
Greg W
Thanks, but this still has no effect, I just see the original page. I know my top level .htaccess is working though because I use it for 301's etc. I tried it with [QSA,L] at the end also but that doesn't change anything.
pg
Make sure you have enabled rewrite engine in .htaccessRewriteEngine onAlso make sure in your web server configuration (assuming apache) you have mod_rewrtite loaded. If you don't have access to configuration, make a simple php script, put phpinfo() then check about loaded modules.
Michael