Web Design Forum: slight htaccess problem - Web Design Forum

Jump to content

WDF
WDF Premium Memberships Reseller Hosting
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

slight htaccess problem Rate Topic: -----

#1 User is online   brightonmike 

  • Web Guru
  • PipPipPipPipPip
  • Group: Members
  • Posts: 2,996
  • Joined: 27-June 11
  • Reputation: 340
  • Gender:Male
  • Experience:Intermediate
  • Area of Expertise:Web Designer

Posted 11 January 2012 - 09:41 AM

I'm using this to stop people nicking my bandwidth:

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?maxumi\.co.uk/ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*\.(jpe?g|gif|bmp|png)$ http://i52.tinypic.com/rkvvqb.png [L]


I need to add support though for my .com domain.

Can I just copy the first line and change to .com?

Cheers.
0

#2 User is online   Jay Gilford 

  • Web Guru
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,105
  • Joined: 11-October 09
  • Reputation: 185
  • Gender:Male
  • Experience:Web Guru
  • Area of Expertise:Web Developer

Posted 11 January 2012 - 09:43 AM

Technically you should escape the . between the co and uk in your code above like so
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?maxumi\.co\.uk/ [NC]

For the .com you can use
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?maxumi\.com/ [NC]


1

#3 User is online   Jay Gilford 

  • Web Guru
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,105
  • Joined: 11-October 09
  • Reputation: 185
  • Gender:Male
  • Experience:Web Guru
  • Area of Expertise:Web Developer

Posted 11 January 2012 - 09:46 AM

By the way, if you use the same file for both, you could use which would cover both domains
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?maxumi\.co(m|\.uk)/ [NC]

2

#4 User is online   brightonmike 

  • Web Guru
  • PipPipPipPipPip
  • Group: Members
  • Posts: 2,996
  • Joined: 27-June 11
  • Reputation: 340
  • Gender:Male
  • Experience:Intermediate
  • Area of Expertise:Web Designer

Posted 11 January 2012 - 10:59 AM

Brilliant, thanks buddy :)
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users