• Hi,

    I decided to migrate to a better permalink structure and opted in for /%postname%/ instead of /%postname%.html

    Here’s what I did:
    1. Changed permalink structure under General-> Permalinks to “Postname”
    2. Added following line in .htaccess (at the top even before w3tc settings and default wordpress settings)
    RedirectMatch 301 ^/([^/]+).html$ https://www.example.com/$1
    3. Flushed the cache.

    Now, all the individual articles are being redirected properly with no issues at all. However, the homepage is throwing 404 not found error.

    I am not sure what am I doing wrong. Also, I am not using any sort of redirection plugin.

    Any help will be appreciated.

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

    (@t-p)

    You don’t need to do any redirects.

    WordPress should automatically redirect when you change the permalink structure of your blog, because it depends entirely on server configuration. Try it out, it should only take a minute and you can always change back

    Thread Starter ParitoshBh

    (@paritoshbh)

    No, that doesn’t happen. If I do so, without any redirects then except for homepage all other post pages return a 404 error.

    Moderator t-p

    (@t-p)

    Thread Starter ParitoshBh

    (@paritoshbh)

    The mod_rewrite module is active and working. Already confirmed with knownhost support. I have been through the troubleshooting section a number of times now.

    Thanks for the link ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Homepage throwing 404 error after permalink redirection’ is closed to new replies.