Forum Moderators: phranque

Message Too Old, No Replies

mod rewrite

         

ryland22

9:04 pm on Mar 26, 2009 (gmt 0)

10+ Year Member



Currently my url looks like this:
www.mysite.com/product.color,type,cat

Rewrite rule is this:
RewriteRule product.([A-Za-z0-9\-]+),([.0-9A-Za-z\-]+),([A-Za-z\-]+) product.php?color=$1&type=$2&cat=$3 [NC]

I need to append an email address onto the end of the url like this:

www.mysite.com/product.color,type,cat?email=mike@aol.com

When I try to do so, the get variable 'email' doesn't have any data in it EG: $_GET['email'].

The email address may or may not be appended to the url. Is there any easy way to solve this using mod_rewrite?

Thanks!

g1smd

9:06 pm on Mar 26, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Add [L] and [QSA] to the end of the rewrite. The [QSA] will re-append the original query string.

In your patterns, change [A-Za-z] to just [A-Z] because the [NC] flag says to use any case.

Ahead of the rewrite, make sure you have a site-wide non-www to www redirect in place to stop Duplicate Content issues.

ryland22

9:44 pm on Mar 26, 2009 (gmt 0)

10+ Year Member



Sweet! Works perfect - muchas gracias.

g1smd

10:22 pm on Mar 26, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Have you got your final code, for reference?