mod_rewrite and special characters (%)

I have a site in “exostic” language. For SEO purposes, I have in url special characters. I don’t want to change url because than I would loose SEO benefit of having title in url.

Example:
www.imedomene.com/ποδόσφαιρο
=>
www.imedomene.com/ποδόσφαιρο
which is actually
www.imedomene.com/article.php?title=ποδόσφαιρο

I would like to make rewrite_rule ^/?(/anything)$ /article.php?url=$1 [L]

The problem is when inside everything is %.
I tried RewriteRule ^/?(.*)$ /article.php?url=$1 [L], I have googled half day and checked hundreds of sites and still didn’t find solution. Is even possible without any server configuration (I don’t have access as I use sharing hosting) solve this with .htaccess?

I hope anybody can help me!

meee,

Non-Latin languages are difficult to work with in mod_rewrite (obviously). HOWEVER, IF Apache is configured to recognize your language (as it appears to be), then you can use the same technique as [a-z] by using your language’s equivalent, i.e., [a-zφ-ρ] (please don’t laugh, I have no idea the order of the characters in your alphabet - just use your first and last letters separated by a hyphen).

Regards,

DK

I found a solution. If anybody else need, this is what I did:
RewriteRule ^/?([^/.]+)$ /article.php?url=$1 [L]

meee,

Sorry for the delay, I lost my ADSL modem to a fault.

The language is not determined by where the server is located but by the languages selected. While I’m not using languages on my test server, its (default) httpd-languages.conf file is:

If your language isn’t in there, it’s not of this planet!

[QUOTE=meee;4694839]dklynn the problem is that I have hosting in a country where latin charaters are used, I don’t believe Apache is configured to recognize my website language.

Gudonya! Your method of using the articleId is a great way around the problem of using non-Latin characters for the article titles. I PREFER to use the title - even in other languages - but you need (a) to have your language available on the server and (b) to be able to specify the character range of your characters (use the characters’ hex values to determine the start and end characters but USE THOSE CHARACTERS in your character range definition!).

Regards,

DK

I am also wondering why RewriteRule ^/?(.)/([-a-zA-Z_&0-9&,!]+)$ /article.php?url=$1 [L] works and ^/?(.)$ /article.php?url=$1 [L not? Why if I include /articleId starts to work?

dklynn the problem is that I have hosting in a country where latin charaters are used, I don’t believe Apache is configured to recognize my website language.

I tried now to use
RewriteRule ^/?(.*)/([-a-zA-Z_&0-9&,!]+)$ /article.php?url=$1 [L]
www.domainname.com/الشباكيةالمغربية/articleId (articleid as number)
instead of
www.domainname.com/الشباكيةمربية
This is a bit closer and works, but I need then to include article id in url.

Than I tried also
www.domainname.com/الشباكيةالمغربية/ (no need to include articleId, just /)
RewriteRule ^/?(.)/(.)$ /article.php?url=$1 [L]
which is the nearest solution. This also display a page without error, excepting css (I don’t know why). Anyway I am not enough familier to replace second .* with a rule nothing but just /. I hope anybody can help with this.

Tnx a lot!

That RewriteRule looks OK to me. Normally I’m not too fond of .* because it’s kinda evil, but when you need to handle a lot of exotic chars it certainly is simpler than listing all of those special characters.

Are you sure the server has mod_rewrite and did you put RewriteEngine On in your .htaccess before the RewriteRule ?