Forum Articles
  Welcome back Join CF
You are here You are here: Home | Forum | Website Help (Advance)

You are currently viewing our boards as a guest which gives you limited access to view most of the discussions, articles and other free features. By joining our Virgin Media community you will have full access to all discussions, be able to view and post threads, communicate privately with other members (PM), respond to polls, upload your own images/photos, and access many other special features. Registration is fast, simple and absolutely free so please join our community today.


Welcome to Cable Forum
Go Back   Cable Forum > Computers & IT > Internet Discussion
Register FAQ Community Calendar

Website Help (Advance)
Reply
 
Thread Tools
Old 04-08-2004, 18:34   #1
JediMaster
Inactive
 
JediMaster's Avatar
 
Join Date: Jan 2004
Location: Swansea
Posts: 1,376
JediMaster is just so famous around these partsJediMaster is just so famous around these partsJediMaster is just so famous around these partsJediMaster is just so famous around these partsJediMaster is just so famous around these partsJediMaster is just so famous around these partsJediMaster is just so famous around these partsJediMaster is just so famous around these partsJediMaster is just so famous around these partsJediMaster is just so famous around these partsJediMaster is just so famous around these partsJediMaster is just so famous around these partsJediMaster is just so famous around these partsJediMaster is just so famous around these partsJediMaster is just so famous around these parts
Question Website Help (Advance)

I am in need of a STRANGE request

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..
JediMaster is offline   Reply With Quote
Advertisement
Old 04-08-2004, 18:37   #2
Bifta
Inactive
 
Join Date: Jul 2003
Location: Eglinton, Co. Derry
Posts: 7,640
Bifta has a nice shiny starBifta has a nice shiny star
Bifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny star
Re: Website Help (Advance)

http://www.alistapart.com/articles/hotlinking/
Bifta is offline   Reply With Quote
Old 05-08-2004, 14:03   #3
JediMaster
Inactive
 
JediMaster's Avatar
 
Join Date: Jan 2004
Location: Swansea
Posts: 1,376
JediMaster is just so famous around these partsJediMaster is just so famous around these partsJediMaster is just so famous around these partsJediMaster is just so famous around these partsJediMaster is just so famous around these partsJediMaster is just so famous around these partsJediMaster is just so famous around these partsJediMaster is just so famous around these partsJediMaster is just so famous around these partsJediMaster is just so famous around these partsJediMaster is just so famous around these partsJediMaster is just so famous around these partsJediMaster is just so famous around these partsJediMaster is just so famous around these partsJediMaster is just so famous around these parts
Re: Website Help (Advance)

Quote:
Originally Posted by Bifta
Thanks for that Bifta..

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?
JediMaster is offline   Reply With Quote
Old 05-08-2004, 14:06   #4
Bifta
Inactive
 
Join Date: Jul 2003
Location: Eglinton, Co. Derry
Posts: 7,640
Bifta has a nice shiny starBifta has a nice shiny star
Bifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny star
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.
Bifta is offline   Reply With Quote
Old 05-08-2004, 14:33   #5
Bifta
Inactive
 
Join Date: Jul 2003
Location: Eglinton, Co. Derry
Posts: 7,640
Bifta has a nice shiny starBifta has a nice shiny star
Bifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny star
Re: Website Help (Advance)

You can try this in each of your documents.

Code:
<script language="javascript">
if {document.referrer.indexOf("website.com") == -1} 
window.location = "http://redirecturlinhere";
</script>
Bifta is offline   Reply With Quote
Old 05-08-2004, 15:52   #6
greencreeper
Inactive
 
Join Date: Nov 2003
Location: Leeds - the dog house
Age: 49
Services: Email me for a current price list
Posts: 8,270
greencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny star
greencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny star
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.
greencreeper is offline   Reply With Quote
Old 05-08-2004, 16:12   #7
JediMaster
Inactive
 
JediMaster's Avatar
 
Join Date: Jan 2004
Location: Swansea
Posts: 1,376
JediMaster is just so famous around these partsJediMaster is just so famous around these partsJediMaster is just so famous around these partsJediMaster is just so famous around these partsJediMaster is just so famous around these partsJediMaster is just so famous around these partsJediMaster is just so famous around these partsJediMaster is just so famous around these partsJediMaster is just so famous around these partsJediMaster is just so famous around these partsJediMaster is just so famous around these partsJediMaster is just so famous around these partsJediMaster is just so famous around these partsJediMaster is just so famous around these partsJediMaster is just so famous around these parts
Re: Website Help (Advance)

Quote:
Originally Posted by greencreeper
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.
My Brain HURTS LOL

So much info...

Can you post what I need to type ? & where to stick it (No NOT that PLACE )

If Referal comes from www.suzip.co.uk ALLOW to URL1.com if NOT off www.suzip.co.uk send to url2.com

Thanks
JediMaster is offline   Reply With Quote
Old 05-08-2004, 16:14   #8
Bifta
Inactive
 
Join Date: Jul 2003
Location: Eglinton, Co. Derry
Posts: 7,640
Bifta has a nice shiny starBifta has a nice shiny star
Bifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny star
Re: Website Help (Advance)

Code:
<script language="javascript">
if {document.referrer.indexOf("suzip.co.uk") == -1} 
window.location = "url2.com";
</script>
Stick it in your <head> tags.
Bifta is offline   Reply With Quote
Old 05-08-2004, 16:38   #9
Bifta
Inactive
 
Join Date: Jul 2003
Location: Eglinton, Co. Derry
Posts: 7,640
Bifta has a nice shiny starBifta has a nice shiny star
Bifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny star
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]
Bifta is offline   Reply With Quote
Old 05-08-2004, 17:42   #10
greencreeper
Inactive
 
Join Date: Nov 2003
Location: Leeds - the dog house
Age: 49
Services: Email me for a current price list
Posts: 8,270
greencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny star
greencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny stargreencreeper has a nice shiny star
Re: Website Help (Advance)

Quote:
Originally Posted by JediMaster
My Brain HURTS LOL

So much info...

Can you post what I need to type ? & where to stick it (No NOT that PLACE )

If Referal comes from www.suzip.co.uk ALLOW to URL1.com if NOT off www.suzip.co.uk send to url2.com


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 - \.
greencreeper is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 23:55.


Server: lithium.zmnt.uk
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
All Posts and Content are © Cable Forum