Forum Moderators: phranque
I'm new to some advanced .htaccess stuff, so bear with me.
I currently have this is my .htaccess file:
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?example.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*\.(jpe?g¦gif¦bmp¦png)$ - [F]
Thanks,
Steven
[edited by: jdMorgan at 4:52 am (utc) on Mar. 28, 2007]
[edit reason] Example.com. Please see TOS. [/edit]
Options +FollowSymlinks
RewriteEngine on
#
RewriteCond %{HTTP_HOST} !^www\. [b][NC][/b]
RewriteRule (.*) http://www.%{HTTP_HOST}/$1 [R=301,L]
#
RewriteCond %{HTTP_REFERER} .
RewriteCond %{HTTP_REFERER} !^http://[b]www\.(forum\.¦gallery\.)?example\.com[/b]
RewriteRule [b]\.(jp[/b]e?g¦gif¦bmp¦png)$ - [F]
You might consider getting rid of the redundant "www" subdomain level for "forum" and "gallery" -- It would be perfectly-acceptable, and even preferable from a technical standpoint (and shorter), to use www.example.com, forum.example.com, and gallery.example.com.
Replace all broken pipe "¦" characters above with solid pipe characters before use; Posting on this board modifies the pipe characters.
Jim