• I recently changed the permalink structure of my url’s. Since changing the links over I have noticed that some of my blog post links end in .html and the links that end in .html throw up a 404 error. If I remove the .html the links work but this obviously isn’t very practical.

    I have been looking online for days not for a solution and can’t find anything on removing the.html or redirect that seems to work. I have tried several codes in the htaccess file but to no effect.

    I would REALLY appreciate any help.

    Thanks.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Moderator t-p

    (@t-p)

    Do you see .html in the permalinks structure set in
    Dashboard – settings

    Thread Starter lindyloves

    (@lindyloves)

    Hi Tara,

    No there is no html in the new permalinks structure and as far as I am aware there never was which is why I’m so confused about it.

    I have noticed that some of my blog post links end in .html

    @lindyloves Where is it that you’re seeing these links ending in .html? Are they showing up somewhere on your site where we’d be able to see them, and if so, can you provide us with a URL so we can do that?

    I would Suggest You to go to wp-admin/options-permalink.php

    and Under CUSTOM STRUCTURE USE /%postname%/

    Click Update

    It will WORK, You need to UPDATE URLS Use any STRUCTURE you want

    Thread Starter lindyloves

    (@lindyloves)

    Hi, thank you for the replies!

    I managed to sort the html problem (I think!). It seems I had two htaccess files and the one I was using wasn’t the correct one so the code wasn’t having any effect. I deleted one and put the code in the other file and it is now redirecting from the .html.

    I do however have a new problem… Every so often my site says too many redirects and doesn’t load.

    The code I have in the htaccess file is:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On

    RedirectMatch 301 ^/([0-9]{4})/([0-9]{2})/(?!page/)(.+)$ https://www.lindyloves.co.uk/$3

    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    #html
    RewriteCond %{THE_REQUEST} \.html
    RewriteRule ^(.*)\.html$ /$1 [R=301,L]

    </IfModule>

    # END WordPress

    Thanks again for the replies, much appreciated!

    Thread Starter lindyloves

    (@lindyloves)

    Okay, I have had to edit the htaccess file as I removed a sentence and just realised that my pages were not being found. It now reads:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On

    RedirectMatch 301 ^/([0-9]{4})/([0-9]{2})/(?!page/)(.+)$ https://www.lindyloves.co.uk/$3

    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    #html
    RewriteCond %{THE_REQUEST} \.html
    RewriteRule ^(.*)\.html$ /$1 [R=301,L]

    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    When I try to access my wordpress login area I now get the following error: ERR_TOO_MANY_REDIRECTS Any ideas?

    Thanks.

    Thread Starter lindyloves

    (@lindyloves)

    Please is anyone able to help with this?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Permalink 404 error .html’ is closed to new replies.