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.

What do the links that give you a 404 look like?

http://xxx.xxxx.xxx/clinical/

I suppose xxx.xxxxx.xxx is the correct domain name.
What happens if you set permalink settings to default?

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.

Can you post the htaccess content?

# 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

And this is the htaccess for what permalink setting?

/%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.

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.

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…:smiley:

Absolutely :slight_smile:

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.