GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Any .htaccess masters? (https://gfy.com/showthread.php?t=510774)

kektex 08-31-2005 07:48 PM

Any .htaccess masters?
 
I need some sort of .htaccess rule which will do the following:
I have a bunch of images in a folder that are hotlinked on other servers.I want to delete all these images and redirect all these 404`s so that instead of the hotlinkers getting a nice red X they`ll get a new image I`ll upload to my server.
I know there is a way to do it but I don`t know how.Anyone?

BigBen 08-31-2005 07:55 PM

http://www.htaccesstools.com/hotlink-protection/

fusionx 08-31-2005 08:01 PM

rewriteEngine on
rewriteRule ^http://www.your-site.com/directory-of-images/(.*)$ http://www.your-site.com/newfile.jpg [R=301,L]

everything after 'rewriteEngine on' should be on one line..

kektex 08-31-2005 08:09 PM

Thanks for the help!
Since I was planning to delete the images anyway I found a simple rule for 404`s:
ErrorDocument 404 http://www.domain.com/newfile.jpg

Thanks again!

Lycanthrope 08-31-2005 09:38 PM

Quote:

Originally Posted by kektex
Thanks for the help!
Since I was planning to delete the images anyway I found a simple rule for 404`s:
ErrorDocument 404 http://www.domain.com/newfile.jpg

Thanks again!

Not sure how much / what sort of traffic you have on that domain, but that could be a waste of valuable non-image 404 traffic. The following code will redirect image "404s" to a default image, normal "document" 404s will be treated "normally".

RewriteEngine on
RewriteCond %{REQUEST_URI} !-U
RewriteRule \.(gif|jpg|jpeg)$ /your_path_to/new.gif [L]
# the following is for normal 404s
ErrorDocument 404 http://www.your404.com

pornguy 08-31-2005 09:40 PM

Oh, thanks for reminding me.


All times are GMT -7. The time now is 05:14 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123