Category Archives: arabic

htaccess not redirecting special chars or utf8 chars

Simple Redirect rule:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*) index.php?$1 [L]

Work fine for: http://localhost/masa/admin/sliders/edit/7BMEDIA7D/img/1920x1280/who_are_we.jpg But not for: http://localhost/masa/admin/sliders/edit/%7B%MEDIA%%7D/img/1920x1280/who_are_we.jpg

The difference is with the "%7B%MEDIA%%7D" ...

This happened with some Arabic UTF8 chars, so i now use $_SERVER array to fix it.

my system is Windows 10 64bit , XAMPP server. P.S: all the "AddDefaultCharset utf-8" and other UTF8 flags didnt help.

Apache WebServer redirecting to 404 if URL contains Arabic characters

We are using CMS tool with Tomcat & Apache for Multilingual site. Sometime files or content URL will contain Arabic characters.

On Tomcat Level Arabic Character URLs are working fine. But if we try to access the same page through Apache WebServer URL then we are getting 404 Error.

I added below Characterset in WebServer VitualHost entry but still getting issue. Kindly please help to resolve this issue.

AddCharset ISO-8859-1  .iso8859-1  .latin1
AddCharset WINDOWS-1251 .cp-1251   .win-1251
AddCharset UTF-8       .utf8
AddCharset utf-8       .utf8

http://qutomcat:8080/sites/ar/about/الطلبة    [WORKING]الطلبة     [NOT WORKING] Also in the browser getting below Message:

HTTP Status 404 - /sites/ar/about/اÙØ·Ùبة

Type Status report

message /sites/sites/ar/about/اÙØ·Ùبة

description The requested resource is not available.

Apache Tomcat/7.0.42



Arabic 301 Redirection – Can we 301 Redirect Arabic URLs to another Arabic URL?

Is it possible to 301 redirect one old Arabic URL to another Arabic URL ?

We are using a .net based IIS Server, so performing the updations in the web.config file. Not sure if any settings needs to be changed.

Tried different ways, but due to special charter's the 301 redirection are not working ? Will it work in linux based .htaccess file ?

Can anyone help ?

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]

Storing Arabic Words using Apache Solr 3.6.1

For Arabic to search & index have configured the following ,


<fieldType name="text_ar" class="solr.TextField" positionIncrementGap="100">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.ArabicNormalizationFilterFactory"/>
<filter class="solr.ArabicStemFilterFactory"/>

OUTPUT in Browser:

<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">1</int>
<lst name="params">
<str name="indent">on</str>
<str name="start">0</str>
<str name="q">*:*</str>
<str name="version">2.2</str>
<str name="rows">10</str>
<result name="response" numFound="1" start="0">
<str name="company_name">?????</str>
<str name="id">1</str>
<arr name="search_supplier_keyword">
<str name="supplier_name">?????</str>

But the words in Arabic are not stored instead it stored as Question Mark(??????).

Is there anything i have missed, help me in.

Thanks In Advance

Mod Rewrite and Arabic characters

I currently have the following rules in my .htaccess file that work perfectly for the English site.

RewriteEngine On
RewriteRule ^index.html$ index.php [L]
RewriteRule ^/?([0-9a-zA-Z_-]+)/?$ rewrite.php?param1=$1 [L]
RewriteRule ^/?([0-9a-zA-Z_-]+)/([0-9a-zA-Z_-]+)/?$ rewrite.php?param1=$1&param2=$2 [L]
RewriteRule ^/?([0-9a-zA-Z_-]+)/([0-9a-zA-Z_-]+)/([^/]+)/?$ rewrite.php?param1=$1&param2=$2&param3=$3 [L]

But, on the Arabic website, this throws a "404" error.

Examples that work:

Examples that DO NOT work:الاهدافبنوك

Any idea how to fix that?