![]() |
Website Help (Advance)
I am in need of a STRANGE request :p:
If a website (say www.url1.com ) links to a page, say help.htm (www.url1.com/help.htm) how can I get a script, code or HTACCES to allow this example... www.url1.com/help.htm shows a Page.... But if any other site (say www.url2.com) links to www.url1.com/help.htm another page Displays... (Maybe like a "No Hotlinking or Custom NO Page Found) I dont want a Error 404 thing in HTACCES, but a way to moniter where a link came from & display either the first Page or Second... But both have the same HTML address (www.url1.com/help.htm) & both editable HTML's TIA..:dunce: |
Re: Website Help (Advance)
|
Re: Website Help (Advance)
Quote:
But I think that is for JPG or GIFS only ...... I wanted one that would work on HTML's or PHP Same idea as Image Hotlinking, but if anyone typed the URL in the Address bar or click on a link "Out Side" my site, then it will display another page. But if the link came from my chosen website URL it would allow.. Any Ideas guys? |
Re: Website Help (Advance)
you could set up a php script (or ASP, even javascript) to read the document referrer and redirect them to a different page it the referrer doesn't contain your domain name.
|
Re: Website Help (Advance)
You can try this in each of your documents.
Code:
<script language="javascript"> |
Re: Website Help (Advance)
Correct way is to use mod_rewrite to check the referrer and redirect to your site's main page if the referrer is not your site. The guide for Apache 2 is here:
http://httpd.apache.org/docs-2.0/misc/rewriteguide.html I don't think mod_rewrite is part of the default build though. |
Re: Website Help (Advance)
Quote:
So much info... Can you post what I need to type ? & where to stick it (No NOT that PLACE :mad: ) If Referal comes from www.suzip.co.uk ALLOW to URL1.com if NOT off www.suzip.co.uk send to url2.com Thanks |
Re: Website Help (Advance)
Code:
<script language="javascript"> |
Re: Website Help (Advance)
However .. i've just retested it and it doesn't work :( I'll find something a bit more useful. The trouble is you need to strip out everything after the the final / for the referrer so it's not the most elegant bit of code.
Try putting this in your .htaccess file RewriteEngine On RewriteCond %{HTTP_REFERER} !.*suzip.co.uk.* [NC] RewriteCond %{HTTP_REFERER} !.*suzip.co.uk.* [NC] RewriteRule /* http://whereveryouwanttoredirectpeopleto.com/ [R,L] |
Re: Website Help (Advance)
Quote:
It is a very powerful, and hence complex, piece of software, plus it makes heavy use of regular expressions, which is a language in itself. Bifta's post looks about right. Like I said in my PM, my encounters with rewrite rules have been few and traumatic :) I tend to look for similar examples and build the rules from them, testing as I go. You might have to escape the . in the URL's - \. |
| All times are GMT. The time now is 23:41. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
All Posts and Content are © Cable Forum