Forum Moderators: phranque

Message Too Old, No Replies

how to use .htaccess to disallow external links?

         

abiao

5:42 am on Aug 21, 2009 (gmt 0)

10+ Year Member



for examples, my domain is abc.com, how can i use .htaccess to disallow any other external links in my site, say if there is an external domain: 123.com.

How can i let 123.com becomes my domain abc.com or something else?

tks.

jdMorgan

5:57 pm on Aug 21, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What problem are you attempting to fix here?

You cannot stop people from linking to your pages or images, you can only stop users from loading your pages and images -- and then only if their user-agent provides an HTTP-Referer header. Not all user-agents will provide this header, so there is not solution that will work 100% of the time.

It's not clear if you are trying to prevent hot-linking --to prevent your images appearing on other Web sites' pages-- or whether you want to reject visitors that have followed links from other Web sites to your own Web site.

Jim

abiao

5:11 pm on Aug 22, 2009 (gmt 0)

10+ Year Member



I mean how to replace a link in my site, say how to replace www.abc.com to www.123.com.

jdMorgan

5:17 pm on Aug 22, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The only way to do that is to edit your page (or the script which produces your page) and change the link.

Jim