Iraklis Alexopoulos
Iraklis Alexopoulos

Reputation: 919

Apache .htaccess redirects for URL's with Arabic characters

I have been trying to add some .htaccess redirection rules for URL's with parts in Arabic. Obviously, I am using the Arabic part, URL encoded, but still Apache seems to not be able to resolve the URL, either catch it in the condition or redirect it. Does anyone have any experience on the subject?

This is one line from the config file

RewriteRule ^arabic/%D8%AE%D9%85%D8%B3-%D8%B7%D8%B1%D9%82-%D9%84%D8%B2%D9%8A%D8%A7%D8%AF%D8%‌​A9-%D8%B3%D8%B1%D8%B9%D8%A9-%D8%A7%D9%84%D8%A8%D8%B1%D9%88%D8%AF%D8%A8%D8%A7%D9%8‌​6%D8%AF(.*)$ /blog/sa-ar/%D8%AE%D9%85%D8%B3-%D8%B7%D8%B1%D9%82-%D9%84%D8%B2%D9%8A%D8%A7%D8%AF‌​%D8%A9-%D8%B3%D8%B1%D8%B9%D8%A9-%D8%A7%D9%84%D8%A8%D8%B1%D9%88%D8%AF%D8%A8%D8%A7%‌​D9%86%D8%AF/$1 [R=301,L]

Upvotes: 2

Views: 1230

Answers (1)

Abadis
Abadis

Reputation: 2821

I had the same problem with "م" which is "%D9%85" Just use this:

RewriteRule ^arabic/([\s\S]*)$ /blog/sa-ar/$1

that worked for me! In fact you have to use ^([\s\S]*)$ instead of ^(.*)$

Upvotes: 2

Related Questions