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 Link to comment https://forums.phpfreaks.com/topic/94391-escaping-the-character/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.