In Zend configuration defaults I have these rules:
SetEnv APPLICATION_ENV offline
RewriteEngine On
Options +FollowSymlinks
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
When i try to add fallowing line, notfing happens:
RewriteRule ^en/(.*) $1 [L]
On result I expact to rewrite permomently http://example.com/en/something to http://example.com/something
At now I have both links worked separatly.
Edited:
SetEnv APPLICATION_ENV offline
RewriteEngine On
Options +FollowSymlinks
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteCond %{REQUEST_URI} !^/en/
RewriteRule ^.*$ index.php [NC,L]
RewriteRule ^en/(.*) /$1 [L,R]
This will redirects default language urls directly to site root!
Many thanks.
There is for LigHTTPD:
$HTTP["url"] != "^/en/" {
url.rewrite-once = (
"^/.*" => "index.php?/$1",
)
}
url.redirect = (
"^/en/.*" => "/$1",
)
It’s bceause
RewriteRule ^.*$ index.php [NC,L]is rewriting it and it never gets to the rule you added. You need to add a condition so that requests starting with/en/don’t get rewritten to index.php:Edited:
example.com/en/somethinggets redirected toexample.com/something, then rewritten toindex.php.