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.

viMaL
  • 103
  • 3

1 Answers1

3

Try this:

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