On Nov 13, 2007 5:10 PM, Ki Song <[EMAIL PROTECTED]> wrote:
> 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.)

In human language: the first line checks if the host is
store.knifecenter.com, the second line puts the full query_string (the
bit after the ? in the URL) into %1 and the second line does the
actual rewriting.

Martijn.

---------------------------------------------------------------------
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: [EMAIL PROTECTED]
   "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to