Welcome to WebmasterWorld Guest from 3.85.214.0

Forum Moderators: Ocean10000 & phranque

Message Too Old, No Replies

Foreign chars in url

.htaccess

     
1:47 pm on Oct 30, 2016 (gmt 0)

New User

5+ Year Member

joined:Dec 7, 2010
posts: 35
votes: 2


Here is the part of my .htaccess:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/?key/(.*?)/?$ /search.php?key=$1 [L]
# And in order to redirect the query string URL to the nicer looking one:
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\ /search\.php\?key=([^\&\ ]+)
RewriteRule ^/?search\.php$ /key/%1? [L,R=301]
This give me the clean url, eg: instead this:
http://www.example.com/search.php?key=blablabla
I got this what I need:
http://www.example.com/search/key/blablabla
However, the problem come up with spec. foreign chars, eg:
http://www.example.com/search.php?key=fähigkeiten
give me:
http://www.example.com/search/key/f%25C3%25A4higkeiten
Any help will be appreciated, thanks!
5:24 pm on Oct 30, 2016 (gmt 0)

New User

5+ Year Member

joined:Dec 7, 2010
posts: 35
votes: 2


SOLVED: NE flag in the last line
RewriteRule ^/?search\.php$ /key/%1? [R=301,NE,L]