Jump to content

mod_rewrite trouble


shortysbest

Recommended Posts

I have been able to get part of my url to rewrite correctly, but when it comes to having multiple &'s in url im not sure how to do this.

currently i have three types of URL's that are formed in my site.

1st:

www.*site*.com/index.php?node=home

2nd

www.*site*.com/index.php?node=antiques&page=1

3rd

www.*site*.com/index.php?node=product&id=1

 

right now my mod_rewrite file is

RewriteEngine  On
RewriteBase /
RewriteRule ^([a-zA-Z0-9_-]+)$ index.php?node=$1&product=$2&page=$3 [L]
RewriteRule ^([a-zA-Z0-9_-]+)/$ index.php?node=$1&product=$2&page=$3 [L]

 

and it currently does rewrite the url from

www.*site*.com/index.php?node=home

to

www.*site*.com/home

 

but i am having trouble to get them to rewrite past the first & sign

 

 

Link to comment
Share on other sites

What exactly is causing you trouble? You just match the next 'directory' of the URL and pass it on.

 

RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$ index.php?node=$1&product=$2&page=$3 [L]

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.