Jump to content

User Agent - Indexing PW Protected Pages


kristinaishere

Recommended Posts

Hi,

 

I have a message board where each forum is password protected so certain associations can only access their specified information.

 

Currently to access the page of the message board where they enter their password they have to look through a long list on the main part of the website- find their association name which is a hyperlink -and that takes them to the password page on the message board.

 

I want to use a Google Custom Search engine to allow them to simply search for their association name instead of showing them the long list.

 

The Custom Search would bring up the specified hyperlink name of their association.

 

However, I assume due to password protection over the pages, I am unable to get the custom search to work.

 

I read up and found that I might use a User Agent code like this:

 

$allow_inside = ($is_logged_in) || substr_count($_SERVER['HTTP_USER_AGENT'],'Googlebot');

 

Not sure where I would even put this though, or if it would work... Hoping someone has a suggestion or solution to help!

 

Thanks in advance.

 

 

 

 

Link to comment
Share on other sites

It appears that you would want to place that in a file that is included by the rest of your application. You would want it after the session_start().

 

Maybe the message board has some sort of a bool return auth function that you can put that snippet into and then return true if Apache populates HTTP_USER_AGENT with 'Googlebot'.

 

To test, you can force $_SERVER['HTTP_USER_AGENT'] to equal whatever you want (like Googlebot) ... just be careful that Apache doesn't override it when you think it isn't.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.