Wordpress 404 error on every page except homepage

2019-09-14 20:45发布

I have migrated my wordpress website from my desktop over to siteground for hosting. Prior to doing this I had been using free hosting at x10. The first time I transferred the site everything worked fine. The second time I tried (new version of the website) I found that every page except the home page had a 404 error (this was with x10). I then got hosting at siteground and am still having the exact same problem. Any solutions to this?

My .htaccess file

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

# END WordPress

标签: wordpress
2条回答
闹够了就滚
2楼-- · 2019-09-14 20:52

To fix it

  1. Login to /wp-admin
  2. Go to settings-> Permalinks
  3. and click on save changes button.
查看更多
相关推荐>>
3楼-- · 2019-09-14 21:16

when migrate a wordpress site, you should change the wp_options table siteurl and home url, then login to admin back end -> settings -> permalinks - set the permalinks and save,

Then you can set the .htaccess just set following code and test.

`#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>`
查看更多
登录 后发表回答