WordPress.org

Ready to get started?Download WordPress

Forums

All incoming links giving 404 errors after changing Permalink structure (6 posts)

  1. mansibshah
    Member
    Posted 1 year ago #

    Hi,

    My sire URL is http://funandfoodcafe.com
    I changed my Permalink structure to Postname today, and also added the following redirect line to my .htaccess file:

    RedirectMatch 301 ^/([0-9]{4})/([0-9]{2})/(.*)$ http://funandfoodcafe.com/$3

    All the links on the site redirect to the new structure correctly, but all incoming links, from Google or any other referring sites still go to "http://funandfoodcafe.com/post-name.html" instead of "http://funandfoodcafe.com/post-name/"

    The extra .html is causing all incoming links to result in 404 errors. I get heavy referral traffic, so this is really bad, because its almost like my site is down!

    Can someone help me resolve this issue please?

    Thanks,
    Mansi

  2. Aaron
    Member
    Posted 1 year ago #

    I would undo your .htaccess change and return it to the default code.

    Then if it works leave it alone and install simnple 301 redirect plugin and do your redirect in there instead of .htaccess.

  3. mansibshah
    Member
    Posted 1 year ago #

    HI Aaron, thanks for your answer. I did remove the .htaccess change, so now my file looks like this:

    RewriteEngine on

    # Use PHP5 Single php.ini as default
    AddHandler application/x-httpd-php5s .php

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    I also installed the Simple 301 redirect plugin, and tried changing values there. This is what I use:

    Request
    /%year%/%monthnum%/%postname%.html

    Destination
    /%postname%/

    Does this look correct? its still not fixing the problem though:(
    am I using the correct values?

    Thanks,
    Mansi

  4. Aaron
    Member
    Posted 1 year ago #

    The redirect Plugin is used for individual redirects which it looked like you want. So if you aren't redirecting links then don't use it.

    With your htaccess restored set permalinks in general - permalinks.

    Better?

  5. mansibshah
    Member
    Posted 1 year ago #

    HI Aaron,

    I didn't quite understand your answer, sorry...

    I am not redirecting anymore, I removed the links from there, and then I go to Settings->Permalinks, and choose this option:

    Post name: http://www.funandfoodcafe.com/sample-post/

    But though links from the site are redirecting correctly, the incoming links still go to "%postname%.html" instead of "%postname%", and that is causing all 404 errors.

    For eg:
    incoming (google or referral) link is: http://www.funandfoodcafe.com/caramelized-apple-pancake.html

    correct link should be: http://www.funandfoodcafe.com/caramelized-apple-pancake/

    how do I resolve this discrepency?? all links coming from even social networks like facebook, twitter etc use the .html extension, means all my inbound links are totally disfunctional at this point!

  6. Aaron
    Member
    Posted 1 year ago #

    Got ya.

    Maybe someone might know an easier way but the only way I know is go back to that plugin and redirect them all 1 by 1.

    For instance on the left side you would enter

    /caramelized-apple-pancake.html

    and the right side you would enter

    http://www.funandfoodcafe.com/caramelized-apple-pancake/

    *note you dont enter full URL for left side.

    Now when you get traffic to the .html it will go to the right page. If you have a ton of pages this could take forever and there is possibly a simpler way. But this is the effect you get when you change permalinks on an already established site.

Topic Closed

This topic has been closed to new replies.

About this Topic