tsoltysiak Posted October 3, 2010 Share Posted October 3, 2010 Hi, I've been trying to find an answer to this using search, but haven't seen anything like it. I was wondering whether it is possible to rewrite URLs so that a certain portion acts as a query string, something like this example: RewriteRule ^bagreg/$ bagreg.php? RewriteRule ^special/$ special.php? RewriteRule ^/airlines/aircanada/$ &airid=1 RewriteRule ^/airlines/westjet/$ &airid=2 RewriteRule ^/airlines/flyporter/$ &airid=4 RewriteRule ^/category/bikes/$ &categoryid=1 RewriteRule ^/categoryl/golfclubs/$ &categoryid=2 RewriteRule ^/category/windsurfing/$ &categoryid=3 Then once a URL is in the address bar such as: /bagreg/airlines/westjet/ would show this page: bagreg.php?airid=2 and /special/airlines/westjet/category/golfclubs/ would show this page: special.php?airid=2&categoryid=3 Is it possible to do that? Thanks, Tom Quote Link to comment https://forums.phpfreaks.com/topic/215083-rewriting-as-to-query-string/ 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.