httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ki Song>
Subject Re: [users@httpd] Mod_Rewrite from old dynamic page
Date Tue, 13 Nov 2007 19:43:49 GMT
>> How would I write a second rule for:
>> OLD URL: Spec?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$
> 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.

I've made that change and it works perfectly.

One final issue:
For some reason, the productSKU in the old url was frequently followed by a
',' (comma). So, for example,
Spec?productSKU, would be a valid url in the old system.

Is there a way to "drop" the trailing ',' in the old url?

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message