Support » Fixing WordPress » Trailing slash after index.html

  • 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!

Viewing 7 replies - 1 through 7 (of 7 total)
  • 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]

    @mrgad,

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

    S.K

    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.

    Give the url of your blog/site.

    S.K

    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.

    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

    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.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Trailing slash after index.html’ is closed to new replies.