Jump to content

Allow Search engines to access protected webpages


rstewar

Recommended Posts

Hi,

 

I have a site that is alcohol related and by law i must have a page where visitors verify if they are of age.

 

I have a very simple code snippet at the top of each page that checks if the visitor is verified.

<?php

//Start the session
session_start();

/*
* If they haven't passed the age test
* then the age_verified session will not
* be set, since it is only set if they
* say they are 21 years of age.
*/
if(!isset($_SESSION['age_verified'])) {
    header("Location: verify.php");
    exit;
}

?>

 

Is is possible to allow search engines such as Google, Yahoo, Bing, etc. to access these pages and index them? Maybe by verifying the user agent or something?

Hi,

 

I have a site that is alcohol related and by law i must have a page where visitors verify if they are of age.

 

I have a very simple code snippet at the top of each page that checks if the visitor is verified.

<?php

//Start the session
session_start();

/*
* If they haven't passed the age test
* then the age_verified session will not
* be set, since it is only set if they
* say they are 21 years of age.
*/
if(!isset($_SESSION['age_verified'])) {
    header("Location: verify.php");
    exit;
}

?>

 

Is is possible to allow search engines such as Google, Yahoo, Bing, etc. to access these pages and index them? Maybe by verifying the user agent or something?

 

i`m not sure if you talk only stupid things but this you could achieve creating an array with the user agent of the bots(i think you can find on google about them) but for someone smart and with firefox could enter on your website by changing the user agent.

 

 

click check this out for more information's.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.