Link to home
Create AccountLog in
Avatar of high_420
high_420

asked on

I can't index my password protected pages with my search engine HELP!!

I need help indexing my password protected pages with my search engine which is the isearch engine.
Avatar of TeRReF
TeRReF
Flag of Netherlands image

If you want to index them, why do you password protect them then?
Avatar of high_420
high_420

ASKER

for members only I want my own search egine to index them.
I don't think you can do it directly via isearch (unless you have the professional edition, which allows you to alter the sourcecode)
You will need to find ways around it. You could add a flag to your password protected pages to allow the search engine to go ahead without logging in (maybe check ip, user agent and so on...)
Any ideas on how to acomplish this. I do have the pro version but
I'm using php 5 on my web pages.
Can you show me the code that handles the login on your pages?
Here is my code

<?php
# User is redirected here from login.php.

session_name ('ID');
session_start(); // Start the session.

// If no session value is present, redirect the user.
if (!isset($_SESSION['agent']) OR ($_SESSION['agent'] != md5($_SERVER['HTTP_USER_AGENT'])) ) {

      // Start defining the URL.
      $url = 'http://' . $_SERVER['HTTP_HOST'];
      // Check for a trailing slash.
      if ((substr($url, -1) == '/') OR (substr($url, -1) == '\\') ) {
            $url = substr ($url, 0, -1); // Chop off the slash.
      }
      $url .= '/login.php'; // Add the page.
      header("Location: $url");
      exit(); // Quit the script.
}
?>
ASKER CERTIFIED SOLUTION
Avatar of humeniuk
humeniuk
Flag of Canada image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer