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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.