• So I have tried multiple times to fix this issue, however Ahrefs keeps showing me an error related to have duplicate pages which is the same page, but one under HTTP, and the other under HTTPS.

    I currently have 2 robots.txt files setup, one for the http, and the other for https.

    The HTTP one looks like this:

    #Robots.txt for HTTP

    User-agent: *
    Disallow: /wp-admin/
    Disallow: /wp-content/plugins/
    Disallow: /readme.html/

    Then the HTTPS one looks like this

    #Robots.txt for HTTPS

    User-agent: *
    Disallow: /

    If I have this setup, the HTTPS pages shouldn’t be seen right?

Viewing 1 replies (of 1 total)
  • The robots.txt file isn’t the ideal way to handle this situation. Instead, I would look at adding the appropriate rules to your .htaccess file that redirects users/search engines from http to https (or vice versa) for every page on the site. It can be accomplished with just a few lines in the .htaccess file. Search Google for samples of what you need to do.

    Once you have .htaccess working, remove the Disallow from your robots.txt.

Viewing 1 replies (of 1 total)

The topic ‘Fixing duplicate pages HTTPs and HTTP’ is closed to new replies.