• I do many wordpress migrations form one server to another in my line of work at https://ezsitemove.com and I was wondering why migrating a wordpress installation to another server breaks the permalinks? Clicking on the normal wordpress pages after a migration will produce a 404 error.

    It’s a pretty simple fix, login to the admin section, navigate to your permalink structure and hit “save”. You don’t even have to change them. Simply saving them fixes the error.

    However, I can’t help to think that this is a bug. Even if it’s not a “bug” per se, it would still be really nice to have it fixed.

    I await some feedback on the matter.

    Gary

Viewing 15 replies - 1 through 15 (of 31 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Because you have to rebuild the permalink rules for the new server. Saving them rebuilds the data in your database.

    Thread Starter gdawkins

    (@gdawkins)

    Hey Ipstenu,

    What if I want to automatically rebuild them in the database?

    After uploading the database to the new server the permalink_structure is correct:
    /%year%/%monthnum%/%day%/%postname%/

    That part doesn’t change, so what is it that actually changes when the “Save” button is clicked in the admin section and where can I manually update those in the database so that I don’t have to login to the admin section to do it?

    I appreciate the help,

    Gary

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    That’s an answer I wish I knew. ?? It’s a pain for a moved MultiSite install, and I have yet to sort out how.

    Anyone fix the broken permalinks issue?. I too have done a server migration and permalinks cause 404 error.

    Thread Starter gdawkins

    (@gdawkins)

    Have you logged into your admin section and clicked “Save” for your permalink structure? Also, you can double check that you have the right information in your .htaccess file, a default wordpress .htaccess should look like:

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

    Don’t forget to update the two entries in your database’s wp_options table as well.

    Hi gdawkins

    ‘Don’t forget to update the two entries in your database’s wp_options table as well’. Could you elaborate?

    Thread Starter gdawkins

    (@gdawkins)

    Yes, in your wp_options table you’ll need to update your “SiteURL” row on page 1 and your “Home” row on page 2. You’d usually use phpMyAdmin to do so.

    I forgot to mention, this is just for cases where you’ve changed your domain name or directory structure of the wordpress install. If you’re using the same domain and didn’t change directories then you won’t need to worry about this step.

    Ok I will try it out, many thanks for your speed reply.

    what do I update the SiteUrl row and the Home row with?

    Thread Starter gdawkins

    (@gdawkins)

    The full URL to your current wordpress blog:

    For example: https://example.com/blog

    Hi

    Yes they are correct, but still getting 404 error. The homepage of the site loads but the links to other pages are broken.

    Thread Starter gdawkins

    (@gdawkins)

    Have you logged into your admin section and clicked “Save” for your permalink structure?

    The internal links work when I revert back to default permalinks but when I change and save to custom the links are broken, 404

    Any ideas?

    Thread Starter gdawkins

    (@gdawkins)

    What’s the new domain name with the 404 errors on it?

    when I make custom permalink to /%category%/%postname%/ i get the 404 error

Viewing 15 replies - 1 through 15 (of 31 total)
  • The topic ‘Permalinks Break after Server Migrations’ is closed to new replies.