views:

23

answers:

1

Im trying to rewrite a url that has a query string to its SEO friendly name

i.e. consider

mysite.com/models?p1=v1&p2=v2&p3=v3&p4=v4&p5=v5&p6=v6

Id like it to rewrite to

mysite.com/models/v1/v2/v3/v4/v5/v6 

or

mysite.com/models~v1~v2~v3~v4~v5~v6

whichever works better for SEO. any suggestions

j

A: 
RewriteRule ^/models/([^/]+)/([^/]+)/([^/]+)$ models?p1=$1&p2=$2&p3=$3

Remember, that directory from "browser view" will be now /models/xx/xx/xx/ not gloal /. So be sure that links to styles, images etc. are global, because after that rewrite, they can stop working.

You can also rewrite every link (excluding css,images,swf etc.) to 'models' and parse $_SERVER["QUERY_STRING"] in php (explode by "/" and fill parameters from array)

killer_PL