Mobile app version of vmapp.org
Login or Join
Merenda212

: Can .htaccess 301 redirects work with encoded characters? I have an old site with titles in the URL for SEO, but it has URL encoded characters than transliterated Latin characters. Like %20

@Merenda212

Posted in: #Htaccess #Internationalization #Redirects #Url

I have an old site with titles in the URL for SEO, but it has URL encoded characters than transliterated Latin characters. Like %20 instead of space character and many other non-Latin characters. The site is not in English.

I'm moving the site to a new CMS and it transliterates the titles before puttng them into URL bar (which is nice and I'm happy to have).

I'm writing 301 redirects in my .htaccess and they work if all characters of the title are in Latin (the same in both side).

How can I redirect the old encoded URLs to the new transliterated URLS using .htaccess?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Merenda212

1 Comments

Sorted by latest first Latest Oldest Best

 

@Martha676

It should just work fine provided that the URL is enclosed in double-quotations.

For example, if you have:


Old URL: www.example.com/folder%20name/page%20name.html New URL: www.example.com/folder/page

You can write:

Redirect 301 "/folder/page%20name.html" www.example.com/folder/page

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme