Redirect urls if contains some Non-English characters using htaccess

332 views Asked by At

I want to redirect any urls that contains some phrases such as تصفیه-آب

For example the below urls must redirect to an exact new url:

example.com/sale-دستگاه-تصفیه-آب-قیمت
example.com/products/تصفیه-آب-sale/

I am using this code in .htaccess file:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule (^|/)sss(/|$) http://example.com [L,NC,R=301]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

</IfModule>

# END WordPress

Now any urls that contains "sss" will redirect to my new url.But if i change the "sss" to my non-English word, will not redirect.

After this step, I want redirect many other urls that contains some characters.I need the new code that work with multiple condition and multiple destination urls.

0

There are 0 answers