SitePoint Sponsor

User Tag List

Results 1 to 14 of 14
  1. #1
    SitePoint Zealot
    Join Date
    Sep 2005
    Posts
    159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    404 on pages after restore from .sql dump

    Hi,

    I've tried taking a copy of my Wordpress site and restoring it to a new site using a .sql export/ import. This seemed to work fine for the homepage/ menus etc but when clicking to other pages I get 404. I can see all the pages in Wordpress. I've tried changing permalink structure. mod_rewrite is enabled. Wordpress can write to .htaccess file.

    I can't find any further clues as to what might be going wrong.

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,496
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    What do the links that give you a 404 look like?

  3. #3
    SitePoint Zealot
    Join Date
    Sep 2005
    Posts
    159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  4. #4
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,496
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    I suppose xxx.xxxxx.xxx is the correct domain name.
    What happens if you set permalink settings to default?

  5. #5
    SitePoint Zealot
    Join Date
    Sep 2005
    Posts
    159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Default works fine, nothing else does.
    I'm kind of assuming that Wordpress is changing .htaccess because I get prompted to reload it in the text editor.

  6. #6
    SitePoint Zealot
    Join Date
    Sep 2005
    Posts
    159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Default works fine, nothing else does.
    I'm kind of assuming that Wordpress is changing .htaccess because I get prompted to reload it in the text editor.
    Actually I've just checked this by switching the permalink structure and reloading, and Wordpress is definitely altering .htacccess.

  7. #7
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,496
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    Can you post the htaccess content?

  8. #8
    SitePoint Zealot
    Join Date
    Sep 2005
    Posts
    159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    # 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

  9. #9
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,496
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    And this is the htaccess for what permalink setting?

  10. #10
    SitePoint Zealot
    Join Date
    Sep 2005
    Posts
    159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    /%postname%/
    I'm wondering if it's because my site is a virtual host in Apache - although having said that I have the original site set up on another server as virtual and it works fine.

  11. #11
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,496
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    The htaccess looks ok. And I always expect it to change with every permalink setting, but it doesn't. The different permalink structures are handled internally by WP. I have no idea why it wouldn't work.

  12. #12
    SitePoint Zealot
    Join Date
    Sep 2005
    Posts
    159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have now. I had omitted to change the AllowOverride directive in httpd.conf to AllowOverride All. It now works fine. Thanks for your time. I often find that just spelling out the different aspects of a problem to someone else helps one to focus..

  13. #13
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,496
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by Enoch Root View Post
    I often find that just spelling out the different aspects of a problem to someone else helps one to focus..
    Absolutely

  14. #14
    SitePoint Member
    Join Date
    Aug 2010
    Posts
    21
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Usually a restore from sql you have to just change to default and save and then put it back to what you had originally. Then it fixes. Then run velvet urls if you changed domains.

    But glad you redid your httacess to fix it.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •