isedeasy Posted November 7, 2011 Share Posted November 7, 2011 I want to have urls that look like the following:- url - www.domain.com/login/ file - /sections/login.php url - www.domain.com/contact/ file - /sections/contact.php my index file just looks for the page name in the query string and includes the appropriate file. I have the following rule that sort of works but I need something that wont lose the rest of the query string. RewriteRule ^([a-zA-Z\_]+)[/]*$ index.php?pl=$1 I need it so that www.domain.com/home/?foo=bar will send my index.php the following vars $_GET['pl']; $_GET['foo']; foo could be anything and the amount of variables that can be passed back needs to be unlimited. Any help would be much appreciated. Thanks Link to comment https://forums.phpfreaks.com/topic/250645-files-to-folders-whilst-keeping-query-string/ Share on other sites More sharing options...
requinix Posted November 7, 2011 Share Posted November 7, 2011 Add a [QSA] flag to the RewriteRule. RewriteRule ^([a-zA-Z\_]+)[/]*$ index.php?pl=$1 [QSA] Link to comment https://forums.phpfreaks.com/topic/250645-files-to-folders-whilst-keeping-query-string/#findComment-1286007 Share on other sites More sharing options...
isedeasy Posted November 7, 2011 Author Share Posted November 7, 2011 Thank you sir, that is exactly what I was looking for! Link to comment https://forums.phpfreaks.com/topic/250645-files-to-folders-whilst-keeping-query-string/#findComment-1286009 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.