The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Lost my html.index page in website.

Discussion in 'General Discussion' started by NRG, Feb 12, 2015.

  1. NRG

    NRG Registered

    Joined:
    Feb 12, 2015
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Hi there,

    Let me start from the beginning. I was using an SEO tool the other day for my website to see how I can improve it. I came across a problem where my web address differs slightly but lands on the same page, for example http://mysite.com, http://www.mysite.com and http://www.mysite.com/index.html it was called Canonicalization, which I am sure many have heard of. I was informed to resolve this issue that I had to access my .htaccess files within file manager in Cpanel and edit it with some code, so that no matter what slight variations the web address was entered the search engine would only point to one actual web address, hence making it more search engine friendly. So I found the code to enter in to my .htaccess files to redirect the various web addresses to one main web address, here is the code that I entered >>

    RewriteEngine On

    RewriteCond %{HTTP_HOST} !^www.mysite.com/index.html$ [NC]
    RewriteRule ^(.*)$ http://www.mysite.com/$1 [L,R=301]

    From my understanding once I had saved the code above in the .htaccess files anyone who entered the web address with http://www.mysite.com/index.html would automatically be redirected to http://www.mysite.com

    But no, now when I enter http://www.mysite.com/index.html I get a page saying "This page cannot be displayed" which is annoying as this is the main web address for my homepage within my site, so each time someone now clicks on home page within my site the above page shows up and not the homepage. My index.html file is still in my file manager in Cpanel, I have also tried to upload my site to reinstall the index.html page in my site, but again I am still getting the same error, "This page cannot be displayed". In the file manager it shows that it was updated when I last uploaded the site too. I have also tried to enter this code to see if I can reinstall the index.html homepage in my site >>

    DirectoryIndex index.html

    But again no joy. I seem to have somehow using the first bit of code in this post deleted the homepage with the tag index.html on it. I have also entered another piece of code in the .htaccess file for a 404 redirect page, which works absolutely fine and has done since I added it a few weeks back. I have scoured the internet to find a solution to this problem so that when the address http://www.mysite.com/index.html page is entered my home page will appear again instead of "This page cannot be reached" and while I was searching I came across your forum. So this morning I decided to write this post to ask for your help in this matter, I am no wiz kid but I have a basic understanding I think, but now I am concerned going back in to my .htaccess files to try and solve this problem, in case I make it worse. So I am asking gratefully to you the forum members if you know a solution or know what I have done wrong, if you could please point me into the right direction so that I can get this page working again. I hope I have giving you a thorough explanation on what is happening and it is an easy fix, if you need any further information please ask and I will reply with the said information. Many thanks in advance for taking time out reading my post. Building a website is a continuous learning curve and I hope to learn from the mistake I seem to have done by now not being able to display my home page with the tag /index.html
     
  2. NRG

    NRG Registered

    Joined:
    Feb 12, 2015
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Hi it is OK I have solved the problem myself and I can now get back to my homepage within my site.
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,724
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page