I was asked to create an existing website with several languages.
In preparation for this, I had to migrate all existing pages from / path / page to / en / path / page
To support any existing inbound links, I now need to set up htaccess redirection to send any requests from their source URLs to the new URLs / en / path / page, but I had problems getting this to work.
This is what I have now;
RewriteCond %{REQUEST_URI} !^/en$ RewriteRule ^(.*)$ /en/$1 [R=301,L]
I think it is intended to check the requested URI, and if it does not start with / en, then preend / en to the requested URI ... but I am obviously mistaken, since it does not work.
Any help appreciated. Thanks.
UPDATE Since this is an ExpressionEngine site and there is an additional rule for deleting part of the index.php URL, here are both rules.
# Rewrite for new language based urls
I also tried this with rewriting the language after index.php one. I'm still looping on the loops.
source share