Rewriting a sub directory problem

Using a single web hosting account to host multiple sites

Rewriting a sub directory problem

Postby clive » Thu Oct 01, 2009 8:58 pm

I have a problem trying to redirect a sub-domain to my main domain.

my redirect is as follows:
# ------------------------------------------------------------------------
# points all subdomain requests to the main domain file structure
# and tags the language indicator query tag to the end
# ------------------------------------------------------------------------
RewriteCond %{HTTP_HOST} ^$ [NC]
RewriteRule ^sv/(.*)$$1?lang=sv

Problem is when the URL is just //
I get: //
without the ?lang=sv tagged on

It works ok if there is something after the to be picked up for the $1 parameter but if there is nothing it seems to ignore the ?lang=sv

Any help would be appreciated....
Posts: 5
Joined: Thu Oct 01, 2009 8:54 pm
Location: France

Postby richardk » Fri Oct 02, 2009 4:09 am

Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_HOST} ^sv\.example\.com$ [NC]
RewriteRule ^sv(/(.*))?$$2?lang=sv [R=301,L]
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 3 guests