Jump to content


Photo

mod rewrite everything


  • Please log in to reply
1 reply to this topic

#1 michaellunsford

michaellunsford
  • Members
  • PipPipPip
  • Advanced Member
  • 1,023 posts
  • LocationLouisiana, USA

Posted 30 January 2006 - 10:03 PM

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:
RewriteRule ^/?([^/]*)\.jpg$ index.php?page=$1 [L,NS]
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":
RewriteRule ^/?([^/]*)$ index.php?page=$1 [L,NS]
but this returns "index.php" -- where it got that is beyond me. I tweak it a bit
RewriteRule ^(.*)$ index.php?page=$1 [L,NS]
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?

#2 Koobi

Koobi
  • Staff Alumni
  • Advanced Member
  • 419 posts
  • LocationColombo, Sri Lanka | South Asia

Posted 14 February 2006 - 09:57 PM

i'm not sure i understand...do you want any file, except for another PHP file to be rewritten to index.php?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users