Prevent Direct Access to Web Page...

User 452266 Photo


Registered User
267 posts

Gunsmoke wrote:
Go to the site in my sig and scroll to the bottom. You'll see 3 icons on a shelf. Click the left most. You won't be disappointed!

However, if you are, shoot me an email and I'll see if I can help. :P


Sorry, but unless I'm missing something, I fail to see where this post has anything at all to do with my post???

May The Good Lord Take A Likin' To You,
Sandcrab3 (Scooterman)
User 187934 Photo


Senior Advisor
20,190 posts

Try this one.;)
<?php
$referrer = $_SERVER['HTTP_REFERER'];
if ($referrer != "http://www.therideahead.org/test/direct/index.html") {
header('Location: http://www.therideahead.org/test/direct … html');
} ;
?>


EDIT
******** I redid it to .html instead of .php because that's what your pages were.;)**********
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2147626 Photo


Ambassador
2,958 posts

Sorry, but unless I'm missing something, I fail to see where this post has anything at all to do with my post???

Sorry. I may have misunderstood, but it sounded like you wanted a simple login system for users to access a restricted page. My bad. :P
Graphics for the web, email, blogs and more!
-------------------------------------
https://sadduck.com
User 452266 Photo


Registered User
267 posts

Eric Rohloff wrote:
Try this one.;)
<?php
$referrer = $_SERVER['HTTP_REFERER'];
if ($referrer != "http://www.therideahead.org/test/direct/index.html") {
header('Location: http://www.therideahead.org/test/direct … html');
} ;
?>


EDIT
******** I redid it to .html instead of .php because that's what your pages were.;)**********


Sorry, still NO GO. I tried the above with index.html & access.html, index.html & access.php, index.php & access.html, and index.php & access.php. I had tried the full URL info before but just tried it again. I have also tried with the edited .htaccess file.

May The Good Lord Take A Likin' To You,
Sandcrab3 (Scooterman)
User 122279 Photo


Senior Advisor
14,454 posts
Online Now

Did you also try renaming your files from html to php?

The change in the .htaccess file apparently does not work on every server. I have some where it works and some where it fails.
Ha en riktig god dag!
Inger, Norway

My work in progress:
Components for Site Designer and the HTML Editor: https://mock-up.coffeecup.com


User 452266 Photo


Registered User
267 posts

Inger wrote:
Did you also try renaming your files from html to php?

The change in the .htaccess file apparently does not work on every server. I have some where it works and some where it fails.


As you can see in my text on the previous quote, I tried every combination.

May The Good Lord Take A Likin' To You,
Sandcrab3 (Scooterman)
User 187934 Photo


Senior Advisor
20,190 posts

That's weird because it works on my server.:/
Make sure it is at the very top of your page with no white space at all.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 187934 Photo


Senior Advisor
20,190 posts

Your page is redirecting correctly for me when I just tested it.;)
http://www.therideahead.org/test/direct/access.html
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 38401 Photo


Senior Advisor
10,951 posts

Try clearing your cache and see if that helps. :)
User 452266 Photo


Registered User
267 posts

Eric Rohloff wrote:
Your page is redirecting correctly for me when I just tested it.;)
http://www.therideahead.org/test/direct/access.html


THANK YOU SO MUCH. Yes, it IS working now.

May The Good Lord Take A Likin' To You,
Sandcrab3 (Scooterman)

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.