.htaccess help - redirect all traffic

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • st0ned
    Confirmed User
    • Mar 2007
    • 8437

    #1

    .htaccess help - redirect all traffic

    I have a myspace resource site (customizeyourpage.com) which I abandoned a long time ago, however it still gets continuous traffic. The site makes little or no money and is a major bandwidth hog. I had kept the site up with plans to eventually sell it, but it doesn't look like I will get around to it...

    Anyway here is what I want to do:
    Create an .htaccess file that will redirect ALL traffic to a URL of my choice. This should include 404 and everything. As I will be deleting EVERYTHING on the server, so whenever someone tries to visit any url (image, page, etc) they should be redirected. How do I go about doing this?

    Also, if its possible, i'd like to replace all the images that are hotlinked with an image that says something along the lines of: "image removed, visit customizeyourpage.com for the new code".

    If anyone could help me out with this I would be grateful, I will compensate you however I can. If you can help, please respond here or hit me up at fizuct[at]gmail[dot]com.

    Thanks
    Conversion Sharks - 1,000+ adult dating offers, traffic management, and consistently high payouts.
    We will guarantee and beat your current EPC to win your dating traffic!
    Skype: ConversionSharks || Email: info /@/ conversionsharks.com
  • FlexxAeon
    Confirmed User
    • May 2003
    • 3765

    #2
    do a search for a "301 redirect" if you're keeping the domain. here's an example of a redirect code i found with a quick search:

    Code:
    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]
    i'm not sure offhand how that will affect hotlinked images, but if it doesn't affect them you could add this to your htaccess:

    Code:
    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !^http://(.+\.)?mysite\.com/ [NC]
    RewriteCond %{HTTP_REFERER} !^$
    RewriteRule .*\.(jpe?g|gif|bmp|png)$ /images/nohotlink.jpg [L]
    with the "/images/nohotlink.jpg" being the location of the image file you described. either way, the 301 would be your primary action to keep getting that traffic
    flexx [dot] aeon [at] gmail

    Comment

    • st0ned
      Confirmed User
      • Mar 2007
      • 8437

      #3
      Originally posted by FlexxAeon
      do a search for a "301 redirect" if you're keeping the domain. here's an example of a redirect code i found with a quick search:

      Code:
      Options +FollowSymLinks
      RewriteEngine on
      RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]
      i'm not sure offhand how that will affect hotlinked images, but if it doesn't affect them you could add this to your htaccess:

      Code:
      RewriteEngine On
      RewriteCond %{HTTP_REFERER} !^http://(.+\.)?mysite\.com/ [NC]
      RewriteCond %{HTTP_REFERER} !^$
      RewriteRule .*\.(jpe?g|gif|bmp|png)$ /images/nohotlink.jpg [L]
      with the "/images/nohotlink.jpg" being the location of the image file you described. either way, the 301 would be your primary action to keep getting that traffic
      Thank you VERY much for your help! I will fool around with a bit and see what I can do.
      Conversion Sharks - 1,000+ adult dating offers, traffic management, and consistently high payouts.
      We will guarantee and beat your current EPC to win your dating traffic!
      Skype: ConversionSharks || Email: info /@/ conversionsharks.com

      Comment

      • st0ned
        Confirmed User
        • Mar 2007
        • 8437

        #4
        Well, its redirecting all traffic. But I can't seem to get it to display the hotlink image at the same time. Any ideas?
        Conversion Sharks - 1,000+ adult dating offers, traffic management, and consistently high payouts.
        We will guarantee and beat your current EPC to win your dating traffic!
        Skype: ConversionSharks || Email: info /@/ conversionsharks.com

        Comment

        • FlexxAeon
          Confirmed User
          • May 2003
          • 3765

          #5
          could be the 301 affecting the hotlinks. like i said i wasn't sure if it would affect outside image linking (i never done a 301 and a hotlink rewrite at the same time ) but i assumed it might

          you could do a softer redirect with javascript or PHP and then use the hotlinking rewite? that would affect your search engine rankings more than a 301 (i think). so the question is...which is more important? displaying the image or redirecting the traffic?
          flexx [dot] aeon [at] gmail

          Comment

          • donborno
            Confirmed User
            • Jan 2007
            • 374

            #6
            Code:
            RewriteEngine On
            RewriteCond %{REQUEST_URI} !(jpg|gif)$
            RewriteRule .* http://www.google.com/ [L,R=302]
            RewriteCond %{REQUEST_URI} !^/?gfy.jpg
            RewriteRule .+\.(jpg|gif)$ /gfy.jpg

            Comment

            Working...