Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8446989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:04:27+00:00 2026-06-10T10:04:27+00:00

in my site i have a redirect via header(location) which only will be executed

  • 0

in my site i have a redirect via header(“location”) which only will be executed when the user logged in not exists, redirecting to the login form. I have a google+ button on this site and google always follows the redirect. I cannot get it why?

When i remove this redirect everything is fine. I tried with this code:

if (!$user->user_exists && !getIsCrawler($userAgent)) {
header("Location: login.php"); }

To detect the crawler i use this function:

$userAgent = $_SERVER['HTTP_USER_AGENT'];
function getIsCrawler($userAgent) { 
$crawlers = 'Google|msnbot|Rambler|Yahoo|AbachoBOT|accoona|' . 'AcioRobot|ASPSeek|CocoCrawler|Dumbot|FAST-WebCrawler|'
 .'GeonaBot|Gigabot|Lycos|MSRBOT|Scooter|AltaVista|IDBot|eStyle|Scrubby'; $isCrawler =
 (preg_match("/$crawlers/", $userAgent) > 0); return $isCrawler; }

What am i doing wrong here? I hope that someone of you have a solution for this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T10:04:28+00:00Added an answer on June 10, 2026 at 10:04 am

    Unfortunately, I don’t think it is possible to get around this problem. Google is known to be using different user agents (with obscure names) in order to check for web pages that show different content to search engines and regular users, or the so called cloaking/doorway pages.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Our site's UI displays read-only text fields which have mouse-click handlers -- when the
I have a fairly simple site which allow users to connect via facebook. I
While performing some upcoming maintenance, I'm going to have to redirect all site traffic
I have a site that i want to redirect all requests accept for 1
I have a site at xyz.com, for some reasons I want to redirect access
I Have done a site but want to redirect it to another subdomain in
I have a mobile site and I'd like to redirect users to the domain.mobi
I need to use mod_rewrite to redirect http://www.site.com/new_cars/cars.php?make=brandname to have a friendlier url of
I have a WordPress site which have 4 pages with one page is a
I have site which uses $(selector).load(path) function in more than 300 pages. Now my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.