.htaccess tutorial

htaccess Elite


prepending query $ w/ "en" when it doesn't contain "cs"|"de"

Ask your mod_rewrite and Redirection questions here, and get answers!

prepending query $ w/ "en" when it doesn't contain "cs"|"de"

Postby garfieldcz » 16 May 2008 10:44

hello, i got a simple task and a problem.
i wanted my .htaccess to prepend "en" if it got a string like "/hotel/menu" not starting with /cs/ or /de/
but i get en/hotel/menu/menu :-0
and even if it starts with "cs" i get en/cs/hotel/menu/hotel/menu
how is this possible? it seems it loops somewhere...

RewriteCond %{REQUEST_URI} !^(cs|de)
RewriteRule ^(.*)$ en/$1
RewriteRule ^(.*)$ nfo.php?TEST=$1 [L]

can you show me a quick fix please?
garfieldcz
 
Posts: 1
Joined: 16 May 2008 10:39

Return to Redirect or Rewrite Questions