Hi everyone, please help me with this bug:
urls www.example.com/fr/home, www.example.com/sk/home,www.example.com/hu/home
are being displayed correctly, where urls: www.example.com/en/home, www.example.com/pl/home, www.example.com/ru/home, www.example.com/cs/home are redirected to www.example.com/ru/ru/home (means 2times language code+'/')
the htaccess file:
RewriteRule ^(en|sk|cs|pl|hu|ru|fr)\/(application)\/(.+)$ ?page=2&$2=$3 [NC,L]
RewriteRule ^(application)\/(.+)$ ?page=2&$1=$2 [NC,L]
RewriteRule ^(en|sk|cs|pl|hu|ru|fr)\/(product)\/(.+)$ ?page=3&$2=$3 [NC,L]
RewriteRule ^(product)\/(.+)$ ?page=3&$1=$2 [NC,L]
RewriteRule ^(en|sk|cs|pl|hu|ru|fr)\/(service)\/(.+)$ ?page=4&$2=$3 [NC,L]
RewriteRule ^(en|sk|cs|pl|hu|ru|fr)\/(news)\/(.+)$ ?page=6&news=$3 [NC,L,NE]
RewriteRule ^(en|sk|cs|pl|hu|ru|fr)+\/(download)\/(.+)$ ?page=9&down=$3 [NC,L]
RewriteRule ^(en|sk|cs|pl|hu|ru|fr)\/(home)$ ?lang=$1 [NC,L]
RewriteRule ^(en|sk|cs|pl|hu|ru|fr)+\/(contact)\/(.+)$ ?page=5&contact=$3 [NC,L]
there is nothing else in the htaccess. and there is no other redirecting of the home page in further code.
Before you do anything else, get rid of all those \/ Directory slashes do not need to be escaped in mod_rewrite.
Your first two pairs of rules make me uneasy because it looks as if they are intended to go together, but there's nothing really binding them.
Best 4 AM guess: some of your directory names contain within themselves the letter sequences "en" or "pl" or "ru", leading to havoc in the rewrites.
And, er, what's with the plusses in
? Now you're raising the possibility of directories named ... uhm, well, it's too late in the night to play Scrabble but I'd be uneasy about the possibilities.
Oh, and if anything is really being redirected, there must be something else in another htaccess or the config file. All of your rules are Rewrites.
come from? All your Rewrites are only concerned with the query string.
thanks lucy, I have found the mistake in the redirection outside htaccess, which I have refused before. consultation helped, good night :)
I would prefix your rewrite target query string in each rule with /index.php to be sure the rewrite operates correctly.
(en|sk|cs|pl|hu|ru|fr)+ would allow a request beginning /frenpl/ or /ruru/ to be valid. Is that what you want?