Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make a private URL?

I want to create a private url as

http://domain.com/content.php?secret_token=XXXXX

Then, only visitors who have the exact URL (e.g. received by email) can see the page. We check the $_GET['secret_token'] before displaying the content.

My problem is that if by any chance search bots find the URL, they will simply index it and the URL will be public. Is there a practical method to avoid bot visits and subsequent index?

Possible But Unfavorable Methods:

  1. Login system (e.g. by php session): But I do not want to offer user login.

  2. Password-protected folder: The problem is as above.

  3. Using Robots.txt: Many search engine bots do not respect it.

like image 473
Googlebot Avatar asked Feb 09 '12 18:02

Googlebot


People also ask

Can you make a URL private?

You might want to share your video only for a specific period, you can use the "private URL". It allows you to send your video without publishing it. This private URL can have an expiry date if you need it.

What does private URL mean?

Anyone who has the link may access the information, but the link is not posted publicly or guessable by an unintended recipient.


2 Answers

What you are talking about is security through obscurity. Its never a good idea. If you must, I would offer these thoughts:

  • Make the link expire
  • Lock the link to the C or D class of IPs that it was accessed from the first time
  • Have the page challenge the user with something like a logic question before forwarding to the real page with a time sensitive token (2 step process), and if the challenge fails send a 404 back so the crawler stops.
like image 101
CrazyDart Avatar answered Sep 21 '22 05:09

CrazyDart


Try generating a 5-6 alphanumeric password and attach along with the email, so eventhough robots spider it , they need password to access the page. (Just an extra added safety measure)

like image 36
Shankar Narayana Damodaran Avatar answered Sep 21 '22 05:09

Shankar Narayana Damodaran