Re: Mod_Rewrite from old dynamic page

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

 



On Nov 13, 2007 6:07 PM, Ki Song <ki@xxxxxxxxxxxxxxx> wrote:
> 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.

Changing the last line to this probably works:
  RewriteRule ^pgi-Product(\ )?Spec$
http://www.knifecenter.com/kc_new/store_detail.html?s=%1
If not, try to replace (\ ) by (\s).

(\ )? means: a space or nothing, so it should match both your cases.
Note that, in the URL you see in the browser, spaces are converted to
%20, but in the URL that is parsed by mod_rewrite, they are converted
back.

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