Log in

View Full Version : Regular Expressions



tacmig99
08-23-2006, 01:40 AM
I'm having a lot of trouble adding a RewriteCond line into my .htaccess file and this (http://etext.lib.virginia.edu/services/helpsheets/unix/regex.html) doesn't seem to help me at all.
So I got this from the comprehensive guide to .htaccess

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain.com/.*$ [NC]
RewriteRule \.(gif|jpg)$ http://www.mydomain.com/angryman.gif [R,L]
But I don't have my own domain name, I am using a sub-domain, and I'm adding all these slashes infront of periodes in an attempt to guess and hope for the best.
How would I go about changing http://www.mydomain.com to http://subdomain.domain.com?

Any and all help appreciated.
Thanks in advance.

Edit: Seems I've figured it out from a link Twey posted in a similar thread :)