What I want to do is force any visitor to go through my index.html page. If they happened to visit one of my subdomains, or browsed into a different directory, even though I set it up that way, I want them to be forced to go through the index.html page first. Let me explain this another way:
I have a directory in my htdocs folder called "chatroom", people can easily bookmark this and have direct access to this folder.
I want to "force" every visitor who tries to go to a subdirectory directly, to automatically be forced back to my main index.html page first, where they would find a menu to choose from where they want to go.
I guess this is kind of a anti-bookmark code in a way.
I already understand and use .htaccess file in my main directory under htdocs, and also have a .htpasswd file under the root, before htdocs.
If anyone understands what it is that I am asking, I would appreciate the help.
Oh yeah, if your gonna tell me it's not a good idea, or it might drive visitors away, blah blah blah. Dont waste your time. I need answers, not opinions.
Thanks.
Force visitors to go through index page?
Moderator: General Moderators
-
sillycheese
- Forum Newbie
- Posts: 3
- Joined: Fri Feb 27, 2004 8:34 am
- Location: philly, pa
what about this at the top of all your pages
Mark
Code: Select all
$referrer = $_SERVER[HTTP_REFERER]."\n";
if ( !preg_match( "/your_domain_name/", $referrer ) ) {
header("Location: index.php");
}-
sillycheese
- Forum Newbie
- Posts: 3
- Joined: Fri Feb 27, 2004 8:34 am
- Location: philly, pa
-
sillycheese
- Forum Newbie
- Posts: 3
- Joined: Fri Feb 27, 2004 8:34 am
- Location: philly, pa
-
d3ad1ysp0rk
- Forum Donator
- Posts: 1661
- Joined: Mon Oct 20, 2003 8:31 pm
- Location: Maine, USA