httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ki Song ...@knifecenter.com>
Subject Re: [users@httpd] Mod_Rewrite from old dynamic page
Date Tue, 13 Nov 2007 18:07:47 GMT
>> How would I write a mod_rewrite rule for the following:
>> OLD URL: http://store.knifecenter.com/pgi-ProductSpec?productSKU
>> NEW URL: http://www.knifecenter.com/kc_new/store_detail.html?s=productSKU
>> 
>> Is there a way to pass the productSKU to the new url?
> 
> How about:
> 
>   RewriteCond %{HTTP_HOST} ^store.knifecenter.com$ [NC]
>   RewriteCond %{QUERY_STRING} ^(.*)$ [NC]
>   RewriteRule ^pgi-ProductSpec$
> http://www.knifecenter.com/kc_new/store_detail.html?s=%1
> 
> (I haven't checked this.)
> 
So far, it's working beautifully! Thanks!
How would I write a second rule for:
OLD URL:  http://store.knifecenter.com/pgi-Product Spec?productSKU
NEW URL:  http://www.knifecenter.com/kc_new/store_detail.html?s=productSKU

Basically, it is the same OLD URL, except there is a space between Product
and Spec. Please note both 'pgi-ProductSpec' and 'pgi-Product Spec' need to
be rewritten.



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message