1

When I type my web page address for the first time in a new browser, the address is automatically added by some strange suffix.

e.g.

www.example.com

automatically become:

www.example.com/?i=1

This is happen for that address only (my web page address only in this case). It does not happen for other ordinary/ common web page addresses.

It keep happening although:

  1. I clear the cache before typing the address.
  2. I refresh the page for many times.
  3. I open it in incognito browser.

The correct address will be exactly correct if I:

  1. Type again the address in the address bar for the second time onward.
  2. Type again in a new tab in the same browser windows.

How to fix this problem so that I can go to the correct address in every first time I type my web page address? Anybody can help me please?

I am using HTML, Javascript, and CSS. I am implementing Google Maps API too. That's why I need my web page visitor visit the correct address for the first time. With /?i=1 suffix, the google maps API will not be displayed because the address is not registered in the google maps developer page.

There are no strange things in my htdocs folder, I suppose. I am not sure that google30bba13d1fbfe55d.html google referrer file and html5reset-1.6.1.css reset file cause it? I am also not sure if my other html file that is not index.html will be the cause?

7
  • Sorry but you have no provided enough information and answers would be speculation. You need to disclose the CMS your using and the contents of your .htaccess file or other related file that controls rewrites. Jan 25, 2018 at 9:39
  • @SimonHayter, Thanks for your advice to improve my question. Is there any other things that I need to add on it? Jan 26, 2018 at 2:38
  • Yep that's fine. Jan 26, 2018 at 17:37
  • It sounds like it could be a cookie check. It isn't going to be the google html file nor the reset css that are causing it. It could be JavaScript based. What happens if you turn off JavaScript in your browser? It could be something in your .htaccess file or other web server configuration files. Is there anything there? What happens if you use redirect testing tools? Jan 26, 2018 at 19:10
  • @SmartPeopleHelpOthers If using cpanel and file manager ensure you click settings 'show hidden files', chances are you have a htaccess causing this. Jan 26, 2018 at 19:28

1 Answer 1

0

The issue that you have is that adding a query string on the end of the URL causes a redirect, because of this, browsers will naturally cache the redirect, saving the visitor having to hop from one URL to the next on the next visit. That's why its essential that you don't use redirects unless you absolutely don't need to.

You can stop browsers caching by setting the header to no cache, choose one of the methods below:

In PHP

<?php
    // NO CACHE METHOD
    header("Cache-Control: no-cache, must-revalidate"); // HTTP 1.1
    header("Pragma: no-cache"); // HTTP 1.0
    header("Expires: Sat, 26 Jul 1997 00:00:00 GMT"); // EXPIRED ON BACK TO THE FUTURE DAY

    // EXPIRE METHOD
    header("Cache-Control: max-age=2592000"); // 30 DAYS (SECONDS)
?>

In HTML

<meta http-equiv="Cache-control" content="no-cache">

In .htaccess

<ifModule mod_headers.c>
    Header unset ETag
    Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
    Header set Pragma "no-cache"
    Header set Expires "Wed, 21 Oct 2015 00:00:01 GMT" # EXPIRED ON BACK TO THE FUTURE DAY
</ifModule>

You should also be aware that Google and Bing does not take a liking to sites that redirect on first visit, since Google will index that one and not the later, also, it is not allowed that you 'detect' Google or Bing bots and treat them any differ than a normal visitor, e.g by IP or User Agent, and neither use cookies.

Therefore you should ensure that Google is redirected to /?i=1 and since Google or Bing bots otherwise you may be subject to a algorithmic penalty for cloaking.

Redirecting on first visit sounds awful for UX and search engines, but if you must add # rather than ? since Google will treat it as the same page.

2
  • I think they are asking how to figure out what is redirecting to add the parameter and how to stop any of those redirects from happening. Jan 26, 2018 at 19:11
  • Oh... I see... misread that lol. Jan 26, 2018 at 19:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.