Reputation: 360
I would like to redirect all requests from http://sub.domain.com
to https://sub.domain.com/en/
.
For example, a customer visiting http://sub.domain.com/test
will be redirected to https://sub.domain.com/en/test/
through htaccess rule.
What rule is needed to accomplish this?
Upvotes: 0
Views: 71
Reputation: 7476
Try it like this,
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ https://sub.domain.com/en/$1 [R=301,L]
Upvotes: 1