- Code: Select all
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.[^.]+\.domain\.dk$
RewriteRule ^(.+) %{HTTP_HOST}$1 [C]
RewriteRule ^www\.([^.]+)\.domain\.dk(.*) /var/www/hotels/dom/$1/html/$2
RewriteCond %{HTTP_HOST} ^[^.]+\.domain\.dk$
RewriteRule ^(.+) %{HTTP_HOST}$1 [C]
RewriteRule ^([^.]+)\.domain\.dk(.*) /var/www/hotels/dom/$1/html/$2
I need to change this so it solved 2 problems
1: As it is now one can write
http://www.subdomain.domain.dk &
http://subdomain.domain.dk
First line is ok. but i want http://subdomain.domain.dk rewritten to include www. in front like this
- Code: Select all
http://subdomain.domain.dk ---> http://www.subdomain.domain.dk
2: Second problem is that i want to have some kind og bandwith protection, since i found that 1/12 of my traffic comes from gif direct linking.
So unless REFERER is from www.sub.domain.dk and/or sub.domain.dk or domain.dk it should redirect to foo.htm
Is all of this possible? Could someone point me in the right direction?