View Full Version : Only allow access to page from within site
jammyjames
06-21-2006, 12:30 PM
Hi,
I know a lot might disagree with what I am trying to do but I need to maximise the opportunity for the site getting seen.
I want to stop people going straight to the main page of my site and make it so if they do they will be redirected to the homepage where they can then get to the page
Is this possible?
Thanks in advance
Bipolar_joe
06-22-2006, 11:28 AM
Sorry, but I don't quite under stand. Aren't the main page and the home page basically the same thing?
ronaldb66
06-22-2006, 11:48 AM
This could be done using some form of server side scripting and a session mechanism; maybe it could be done with client site script and a cookie as well.
mlseim
06-22-2006, 01:48 PM
Whatever page you name "index.html" (or index.htm, index.php) ...
That's the one that is displayed if no specific page is specified.
I too, don't understand the question.
Bipolar_joe
06-22-2006, 01:54 PM
I thought it was just me.
Any who, I'm pretty sure Ronald's right. There might be a script out there for it.
To stop people from getting to the page you don't want them to see, then you could use the robots.txt. That should at least help, I think.
ArcticFox
06-22-2006, 02:00 PM
You could check the document.referrer using JavaScript.
jammyjames
06-22-2006, 02:16 PM
Hi,
Thanks for replying to help.
OK I have a site which has a webcamera as the feature page.
I make money through advertising and to maximise my profit I want to make it so no one can just go striaght to the camera page (unless they are already within the website)
In short: If they click a link from outside my site to the camera they will get directed to the homepage where they can then click the appropriate link.
Does this help?
Thanks again.
www.yarmouthportal.com
jammyjames
06-22-2006, 02:17 PM
How would document.referrer work?
Bipolar_joe
06-22-2006, 02:26 PM
Some one correct me if I'm wrong here.
Document.referrer is what specifies the page that the user was at when they tried to access that specific page. You could put in a script saying that they can only access that page if they come from the page they should have, and if they don't, then they be redirected to it.
Bipolar_joe
06-22-2006, 02:35 PM
Good job on the camera, though. I actually remember the arcade that the camera is pointing at from holidaying in Yarmouth.
felgall
06-22-2006, 09:51 PM
Some one correct me if I'm wrong here.
Document.referrer is what specifies the page that the user was at when they tried to access that specific page. You could put in a script saying that they can only access that page if they come from the page they should have, and if they don't, then they be redirected to it.
document.referrer is a header entry optionally sent by the browser to identify the previous page. It is completely under the control of the browser (subject to any modifications done by the firewall) and is therefore effectively a visitor controlled field - it can contain anything at all although usually it will contain either the prior page or nothing all (if your visitor doesn't want you to know where they came from).
Bipolar_joe
06-23-2006, 08:50 AM
That's an easier way to explain it :) . Thanks for clearing that up.
That's an easier way to explain it :) . Thanks for clearing that up.
it is possible that user can't access specific page before going to home page even if user copy the link from the address bar.
This can be done y creating session object
Regards
Bee
mlseim
06-23-2006, 10:47 PM
I agree with bee ...
If you use PHP (.php as your page extensions), you could use PHP sessions.
The first page starts the session, and on the camera page, you check
the session before you do anything. If not started, then it redirects
back to the first page. It would be tough to get around this one.
http://www.linuxdocs.org/HOWTOs/PHP-HOWTO-15.html
felgall
06-23-2006, 11:33 PM
Sessions will always work.
document.referrer is under your visitor's control.
jammyjames
06-28-2006, 11:45 AM
Thanks for the help guys really appreciate it.
Has anyone done this before?
The link for the howto isn't working can you confirm that it is right?
Thanks
jammyjames
06-29-2006, 10:54 AM
OK I have read through that tutorial but I don't know how to make it so the session is only valid for 24 hours and how to check the session if it is valid.
Does anyone have anymore tips?
Thanks
James
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.