WordPress.org

Ready to get started?Download WordPress

Forums

Trailing slash after index.html (8 posts)

  1. mrgad
    Member
    Posted 5 years ago #

    My default home page is a page (as opposed to a post or recent posts). When visiting the site, htaccess resolves the URL to http://www.example.com/

    If, however, you were to try to visit index.html for the home page by typing in http://www.example.com/index.html, WordPress redirects this to http://www.example.com/index.html/ (note the trailing slash).

    I can't figure out which file in wp-includes to edit to fix this problem. It's interfering with a lot of our tracking and analytics efforts, because "index.html" is not appearing as a visible and viable page.

    Thank you for any help!

  2. jceresini
    Member
    Posted 5 years ago #

    The default page for wordpress is index.php. You're htaccess file probably redirect all requests to that index.php file and it parses them using your permalink settings. If you provide your .htaccess file we may be able to help better. A link your your site would also be useful.

    Try removing or simply renaming the .htaccess file and see if your site exhibits the same behaviour

    [signature moderated Please read the Forum Rules]

  3. S.K
    Member
    Posted 5 years ago #

    @mrgad,

    Check up if you had set your custom permalink as /%postname%.html/ under permalink settings.

    S.K

  4. mrgad
    Member
    Posted 5 years ago #

    Our permalink is custom structure:

    /%postname%.html

    But it is also to some extent modified by using the plugin ".html on Pages".

    I have created a temporary workaround. I created a file called index.html outside of WordPress, and populated it with the raw source code of our home page (which is a static page and never changes, so this is a safe practice, as long as we don't alter site architecture).

    Now, if someone navigates to index.html, it loads this page - and so the problem is "solved," but of course not in the most efficient way.

  5. S.K
    Member
    Posted 5 years ago #

    Give the url of your blog/site.

    S.K

  6. mrgad
    Member
    Posted 5 years ago #

    http://tinyurl.com/mc6o92

    But you won't be able to see the error right now, as I've temporarily created a workaround. I have created a file called index.html outside of WordPress, so this page loads if someone browses to that specific adress.

  7. S.K
    Member
    Posted 5 years ago #

    Going back to the original problem posted by you:

    If, however, you were to try to visit index.html for the home page by typing in http://www.example.com/index.html, WordPress redirects this to http://www.example.com/index.html/ (note the trailing slash).

    I feel it is a remote possibility, unless you had created a "Page" named "index". even then you won't get a trailing slash after index.html in your stated set up.

    Could you please elucidate further.

    S.K

  8. mrgad
    Member
    Posted 5 years ago #

    1. within WordPress, there is no Page created called "index.html" nor anything with that custom permalink.

    2. When I originally posted my question, were you to visit http://www.example.com/index.html, your browser would redirect you to http://www.example.com/index.html/ (with slash)

    3. As I did not figure out a way to fix this, I came up with a workaround. I took the entire source code of my home page, after loaded in a browser, and dumped it into a file I created outside of wordpress, and which I named index.html. Now the problem is solved - so you are not able to see index.html/ (with slash), but it has been solved with a rather clumsy workaround.

Topic Closed

This topic has been closed to new replies.

About this Topic