[ic] Rewrite Condition Help
Stefan Hornburg
racke at linuxia.de
Fri Oct 22 03:36:33 EDT 2004
On Thu, 21 Oct 2004 19:27:34 -0400
"Aftermarket Cellular" <wfiore at aftermarketcellular.com> wrote:
> Hi,
>
> I currently utilize the following rewrite rule in my .htaccess file to
> redirect:
>
> http://aftermarketcellular.com/cellular-accessories/accessories/SKU.php
> TO:
> http://aftermarketcellular.com/~aftermar/cgi-bin/cart.cgi/SKU.html
>
> RewriteRule ^cellular-accessories/accessories/(.+)\.php$
> http://aftermarketcellular.com/~aftermar/cgi-bin/cart.cgi/$1.html
> [R=301,L]
>
> I would like to reverse this redirect:
>
> http://aftermarketcellular.com/~aftermar/cgi-bin/cart.cgi/SKU.html
> TO:
> http://aftermarketcellular.com/cellular-accessories/accessories/SKU.php
>
> The catch is it can only redirect when the SKU contains uppercase
> letters and numbers only, no lowercase. I have been trying to do this
> for some time now but I can't get the rewrite condition correct. Could
> someone help me write a conditional statement to redirect:
>
> http://aftermarketcellular.com/~aftermar/cgi-bin/cart.cgi/SKU.html
> to:
> http://aftermarketcellular.com/cellular-accessories/accessories/SKU.php
>
> BUT NOT REDIRECT
>
> http://aftermarketcellular.com/~aftermar/cgi-bin/cart.cgi/sku.html
Try ([A-Z0-9]+) instead of (.+)
Racke
--
LinuXia Systems => http://www.linuxia.de/
Expert Interchange Consulting and System Administration
ICDEVGROUP => http://www.icdevgroup.org/
Interchange Development Team
More information about the interchange-users
mailing list