Jump to content

Archived

This topic is now archived and is closed to further replies.

michaellunsford

mod rewrite everything

Recommended Posts

The basic idea is to have any request going to a certain directory be parsed by PHP.

So if the browser calls image.jpg. this works great:
[code]RewriteRule ^/?([^/]*)\.jpg$ index.php?page=$1 [L,NS][/code]
which returns "image.jpg" but the directory also has gif, png, pdf, html, php, and who knows what else. So, I tried removing the "\.jpg":
[code]RewriteRule ^/?([^/]*)$ index.php?page=$1 [L,NS][/code]
but this returns "index.php" -- where it got that is beyond me. I tweak it a bit
[code]RewriteRule ^(.*)$ index.php?page=$1 [L,NS][/code]
also returns "index.php" -- in fact, numerous variations of the above (which _should_ be a complete wildcard) also returns "index.php".


I'm so confused. What's missing here?

Share this post


Link to post
Share on other sites
i'm not sure i understand...do you want any file, except for another PHP file to be rewritten to index.php?

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.