• 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 - 16 through 30 (of 31 total)
  • Thread Starter gdawkins

    (@gdawkins)

    Yes, but what is your domain name so that I can take a look at the site?

    Thread Starter gdawkins

    (@gdawkins)

    Ok, which URL’s do you have in your database?

    Can you please copy/paste your .htaccess code here.

    URLs in db https://julianbensonmanagement.com/artists

    There is no htaccess file in the root directory.

    Thread Starter gdawkins

    (@gdawkins)

    There should be a .htaccess file in the /artists directory.

    However, I think the problem is the lack of a / on the end of the URL’s in the database. Try adding a / to the end and see if that helps.

    So I added the / at the end of URL for both Site URL and Home in the db. Didnt work

    So maybe it’s the lack of htaccess in the root of /artists

    Any ideas?

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    You can’t have pretty permalinks without an .htaccess file (on MOST servers).

    As your links are all like this: https://julianbensonmanagement.com/artists/?page_id=545

    You should be fine. What’s not working?

    Thread Starter gdawkins

    (@gdawkins)

    @ipstenu
    He hasn’t been using the default permalinks, he just switched to them, he’s trying to use a custom permalink structure that doesn’t seem to be working.

    /%category%/%postname%/

    Is the one he wants.

    @pixelpie
    Go ahead and create a default .htaccess file for your /artist directory if you’re missing one.

    default as in blank htaccess file?

    Thread Starter gdawkins

    (@gdawkins)

    No, default as in the kind of .htaccess file a default install of wordpress would have.

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

    (@ipstenu)

    ?????? Advisor and Activist

    I he did switch them on, then the links in the menu should have changed to
    https://julianbensonmanagement.com/artists/PAGENAME

    But yeah, you need an .htaccess in the /artist directory ??

    PixelPie, read this: https://codex.www.ads-software.com/Using_Permalinks#Using_.22Pretty.22_permalinks

    Thread Starter gdawkins

    (@gdawkins)

    Yes, he did switch it on and the permalinks were reading as https://julianbensonmanagement.com/artists/PAGENAME and giving 404’s, which is why he went back to the default permalinks for now.

    I think the lack of the .htaccess file may do the trick though so lets see how he comes out after that.

    @pixelpie
    Just remember to change your permalinks back to the custom structure you were trying to use so we can test it again after you’ve added the .htaccess file.

    default htaccess added, permission 777 when saving permalink changes, no didnt work.

    just doble check i have htaccess file correct
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

    Should the RewriteRule be artists/index.php (or something like that)

    Another thing when i imported my database during the migration it asked if it was version MySQL 4.1 or 5.1. Im not sure what version the db is so I selected 4.1 … could this have anything to do with my permalink issue?

    Thread Starter gdawkins

    (@gdawkins)

    If you’re on a Linux server you won’t want 777 permissions since Apache reads that as a security flaw. 644 permissions will be fine. The RewriteRule should be fine as long as this .htaccess file is in your artists folder (along with your wordpress install).

    At this point it’ll be hard to pinpoint the issue without going through some troubleshooting steps which is a lot easier with access to the actual server. Perhaps someone else here could help you but I’d suggest seeking professional help so that you can give full access to the server to someone who works with these problems and knows how to troubleshoot them. For example, a problem like this could easily be solved within an hour with access to the server.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Make it RewriteBase /artists/

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