Forum Moderators: phranque
I want to use htaccess to point the .CO.UK domain to the /EN subfolder.
Following rewrite rules are added by drupal:
# Rewrite URLs of the form 'x' to the form 'index.php?q=x'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*)$ /index.php?q=$1 [L,QSA]
I already added the following rule, resulting in a loop :-S
RewriteCond %{HTTP_HOST} example.co.uk
RewriteCond %{REQUEST_URI} !^/en
RewriteRule ^(.*)$ en/$1 [L]
Hopw can I leave the NL domain on the root while getting the .CO.UK to point to the EN folder, including the drupal rewrite rules.
Can someone help me out please?
Tx
Yoeri
[edited by: tedster at 9:00 pm (utc) on July 26, 2009]
[edit reason] switch domain name to "example" [/edit]
# Redirect non-canonical domain requests to canonical domain
RewriteCond %{HTTP_HOST} example\.co\.nl [NC]
RewriteCond %{HTTP_HOST} !^example\.co\.nl$
RewriteRule ^(.*)$ http://example.co.nl/$1 [R=301,L]
#
RewriteCond %{HTTP_HOST} example\.co\.uk [NC]
RewriteCond %{HTTP_HOST} !^example\.co\.uk$
RewriteRule ^(.*)$ http://example.co.uk/$1 [R=301,L]
#
# Rewrite example.co.nl URLs of the form '/x' to the form
# '/index.php?q=x' (Pass these requests to Drupal script)
RewriteCond %{HTTP_HOST} ^example\.co\.nl
RewriteCond $1 !^index\.php$
RewriteCond $1 !^favicon\.ico$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [QSA,L]
#
# Rewrite example.co.uk URLs to /en subdirectory
RewriteCond %{HTTP_HOST} ^example\.co\.uk
RewriteCond $1 !^en/
RewriteRule ^(.*)$ en/$1 [L]
Jim
The only thing I need to do is:
rewrite http://www.example.nl/ to http://www.example.nl/nl/home
Drupal rewrite rules convert this url to .../index.php?q=nl/home
How can I reirect the root to /nl/home?
thanks
Yoeri
[edited by: jdMorgan at 9:16 pm (utc) on July 28, 2009]