paulman888888 Posted January 1, 2009 Share Posted January 1, 2009 Hi guys; I don't no how to explain so i shall use an example. Users go to events.html MOD REWRITE shows page index.php?where=events THAT ABOVE WORKS FINE. But when i want to start using GET variables i get stuck. Users go to events.html?var_name=var_value MOD REWRITE shows page index.php?where=events&var_name=var_value I cant do the above because... The problem is that the GET variables will always change includeing value and name, i dont want to use loads of sub-folders like var_name/var_value/events.html How can i solve this problem? Please help me Thankyou all in advance Paul Hutchinson Quote Link to comment Share on other sites More sharing options...
ucffool Posted January 2, 2009 Share Posted January 2, 2009 You can setup another divider besides a forward slash (fake folders). You could have the url be something like: variablename~value/events.html The key is something unique. How you build your URL is your choice, just need to make the mod_rewrite understand it. Quote Link to comment Share on other sites More sharing options...
paulman888888 Posted January 2, 2009 Author Share Posted January 2, 2009 so is there anyway to get MOD rewrite the things after the question mark? like events.php?var_name=var_value is there no way i can get everything after the '?'? Thankyou Paul Hutchinson Quote Link to comment Share on other sites More sharing options...
ucffool Posted January 2, 2009 Share Posted January 2, 2009 If you just want the query string to be PASSED ON (they go to /home?something=else and it redirects to home.html?something=else), just add the following flag at the end of the rule: [QSA] For instance: RewriteRule ^/product/([0-9]*)/? /product.php?product_id=$1 [QSA] Maybe I'm just not understanding your question. 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.