Complex twosome soloution

New to mod_rewrite? This is a good place to start.

Complex twosome soloution

Postby maskinen2000 » Sun Sep 15, 2002 2:15 pm

Hi There, I've a small problem.. My mod_rewrite lines is like this

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?
maskinen2000
 
Posts: 1
Joined: Sun Sep 15, 2002 2:07 pm
Location: Copenhagen, Denmark

Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 10 guests

cron