Keep .com domain in subdirectory (htaccess)

Alles, was den Apache betrifft, kann hier besprochen werden.

Keep .com domain in subdirectory (htaccess)

Postby iFritz » 24. January 2010 16:26

Hello freinds,

im redirecting my .com domain into the subdirectory "en".
This works pretty well, but only for the base domain.
For example: www.abc.com becomes www.abc.com/en.
But if i try to open www.abc.com/test1, it stays there, but should become
www.abc.com/en/test1. The subdirectory has not been applied.
Can someone tell me what to do to make this happen'?

Thats the code:
Code: Select all
RewriteCond %{HTTP_HOST} ^(www\.)?abc\.com [NC]
RewriteRule ^$ /en [R=301,L,QSA]
iFritz
 
Posts: 2
Joined: 24. January 2010 16:19

Re: Keep .com domain in subdirectory (htaccess)

Postby Nobbie » 24. January 2010 21:24

You should not use mod_rewrite for that issue, instead you should define a VirtualHost for your domain www.abc.com where the DocumentRoot points to your "en" Subdirectory (use fully qualified path).
Nobbie
 
Posts: 8765
Joined: 09. March 2008 13:04

Re: Keep .com domain in subdirectory (htaccess)

Postby iFritz » 25. January 2010 09:45

Does this work even when the SEF-Tool of the cms creates the en folder virtualy?
iFritz
 
Posts: 2
Joined: 24. January 2010 16:19


Return to Apache

Who is online

Users browsing this forum: No registered users and 2 guests