: How do I redirect an English language URL to an Arabic language URL? I have a link that's currently formatted like this: http://example.com/news/view/1.html I want to it redirect it to: http://example.com/خبر/عنوان-ا
I have a link that's currently formatted like this:
example.com/news/view/1.html
I want to it redirect it to:
example.com/خبر/عنوان-الخبر
where خبر is equal to news and
عنوان-الخبر is the title of the news page. I want ro do it using .htaccess, and provide a permanent 301 redirect for the old URLs.
Do I need to edit the PHP source at all to accomplish this?
More posts by @Berumen354
2 Comments
Sorted by latest first Latest Oldest Best
I don't know if you have to edit the PHP source, I suppose not.
I'd try do that with mod_rewrite:
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^news/view/1.html$ /خبر/عنوان-الخبر [R=301,L]
If it's a one off you just make sure your terminal is in UTF-8 mode, then paste the Arabic into a RedirectMatch as normal.
RedirectMatch permanent ^/news/view/1.html /خبر/عنوان-الخبر
If you wanted it dynamic (i.e. some database which lets you know the title of 1.html) then yes, that would need some PHP.
But if you are saying that 1.html is actually the correct URL, and you just want to change the text that appears in the browser address bar, I don't think that can be done
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2025 All Rights reserved.