Re: Mod_Rewrite from old dynamic page

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Nov 13, 2007 5:10 PM, Ki Song <ki@xxxxxxxxxxxxxxx> 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: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux