0

I wish to redirect(301) a url if the url dont have a string present in it.

eg:

http:://example.com must always redirected to http:://example.com/en

http:://example.com/test.html must always redirected to http:://example.com/en/test.html

http:://example.com/test/another_page must always redirected to http:://example.com/en/test/another_page

like this.

1 Answer 1

3

Try this:

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/en/
RewriteRule /(.*) /en/$1 [L,R=301]

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .