Jump to content

help with htaccess and multipie vars


Alechko

Recommended Posts

Hello folks,

I need a little help with rewriterules in htaccess.

 

I have those files:

product.php?id=*1* (numeric)

vendor.php?name=*HP* (string)

cat.php?id=*141* (numeric)

 

I Rewrited something like that:

 

RewriteEngine On
Options +FollowSymLinks
RewriteRule ^(.+)/$ vendor.php?name=$1

 

that it will be:

domain.com/HP/

 

And I'm stuck.. because I don't have any clue how to Rewrite it to the final result:

domain.com/HP/CatID/ProductID/

 

Thanks..

 

 

Link to comment
Share on other sites

If you have 3 different scripts I would think you would want 3 different rules for example:

 

RewriteRule ^vendor/(.+)$ vendor.php?name=$1
RewriteRule ^category/([0-9]+)$ cat.php?id=$1
RewriteRule ^product/([0-9]+)$ product.php?id=$1

 

Otherwise you may be better off passing the url to a php script to parse out using its regex engine.

 

RewriteRule ^(.+)$ parse.php?url=$1

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.