0

I've got an issue when redirecting one of my blog's url:

http://suitelife.com/category/moving-to-barcelona-tips/barcelona-legality%E2%80%93barcelona-shopping-health-public-transport

As you can see the %E2%80%93 is a pain in the a**, I looked at diverse forums, but no solution there appeared to solve my situation.

I put that line in the .htaccess :

RewriteRule ^category/moving-to-barcelona-tips/barcelona-legality([^.%E2%80%93])barcelona-shopping-health-public-transport(.*)$ category/moving-to-barcelona-tips/barcelona-day-life$1 [R=301,L]

P.S: I've got RewriteEngine On and RewriteBase / etc. I've already redirected other URLs, just this one is not working.

Many thanks in advance! :)

Florian

rusty bit
  • 371
  • 2
  • 17

1 Answers1

1

You can use take regex help to avoid matching that character:

RewriteRule ^category/moving-to-barcelona-tips/barcelona-legality.*?barcelona-shopping-health-public-transport(.*)$ category/moving-to-barcelona-tips/barcelona-day-life$1 [R=301,L,B]

Note use of .*? instead of that character to match any arbitrary string there.

anubhava
  • 761,203
  • 64
  • 569
  • 643