How to redirect a URL with a percentage (%) symbol?

I’m looking to redirect a couple of URLs with percentage (%) symbols in them to clean URLS. Example below…

Old URL:

Read More
http://www.testsite.co.uk/ecommerce/cabinets/white_gloss_cabinets/led_illuminated_white_cabinets%20/9101900.aspx

New URL:

http://www.testsite.co.uk/products/cabinets/austin/

Does anybody know the correct way to format a redirect for this in the .htaccess file? I’m using WordPress.

Thanks

Related posts

1 comment

  1. Try :

    I replaced %20 with s+ in the pattern.

    RewriteEngine on
    
    
    
    RewriteRule ^ecommerce/cabinets/white_gloss_cabinets/led_illuminated_white_cabinetss+/9101900.aspx$ http://www.testsite.co.uk/products/cabinets/austin/ [NC,L,R]
    

    In regex , %20 (a space) is matched using s, or s+ for 1 or more spaces.

    Hope ,this helps!

Comments are closed.