mr_mind Posted March 5, 2008 Share Posted March 5, 2008 This is not really a PHP question as much as an Apache question but regex is the same in both applications so here goes. I have this line of code in a .htaccess file # To redirect everything to the index file to be loaded RewriteRule ^s/(.+).php$ /new/index.php?uri=$1 # I added this in to fix query strings so we dont get stuff like # http://www.example.com/new/index.php?uri=news?show=all # Which would not be fun RewriteRule ^s/(.+).php\?(.+)$ /new/index.php?uri=$1&$2 # But currently the "\?" is not sufficient because in this instance it is searching # it looks for http://www.example.com/new/s/file.php # and http://www.example.com/new/s/file.php\ # # What i want to do is # http://www.example.com/new/s/news.php?show=all # but that does not work. Though this does # http://www.example.com/new/s/news.php\show=all Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.