Jump to content

rewriting as to query string


tsoltysiak

Recommended Posts

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

 

Link to comment
https://forums.phpfreaks.com/topic/215083-rewriting-as-to-query-string/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.