1

I have following site structure

 - root 
     - de/index.htm
     - en/index.htm

When the user requests the site and has not defined the language like

 mysite.com

instead of

mysite.com/en/

I want him to be redirected to the en folder. Because the root folder does not contain any files actually. I am not really familiar with apache rewrite rules. This is what I tried

RewriteEngine On
RewriteBase / 

RewriteCond RewriteCond %{REQUEST_URI} /
RewriteRule ^/en/index.htm

But this does not work. Any ideas how to solve this?

1 Answer 1

1

What you have isn't correct syntax, you've got 2 RewriteCond in a row followed by what looks like the actual condition, then a rule that has no target. Try:

RewriteEngine On
RewriteBase / 
RewriteRule ^/?$ /en/index.htm [L]

If you want what's in the browser's URL address bar to change, add an R flag to the brackets:

RewriteRule ^/?$ /en/index.htm [L,R]
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.