简体   繁体   中英

Wordpress site moved to new server, permalinks work but homepage redirects and creates a WP 404 error

I apologise if this has been asked, I was unable to find clear information anywhere on it.

We've recently been forced into moving to a VPS hosting package.

Thewre were a few issues with links that I managed to fix but now the issue lies with the home page. Every page apart from the home page works as should and at the correct address. Ie website.co.uk/contact instead of /blog/contact.

I assume this has either something to do with the .htaccess file and/or mod rewrite being disabled on the new server.

Most solutions I`ve found all relate to the homepage working and the other pages not. I'm having basically the opposite of this problem.

See http://www.crowdwifi.co.uk it redirects to the /blog/ and creates the 404 Error within Wordpress. You can see from there the other pages and permalinks are fine.

Im on tablet at the moment but can post htaccess code for the root in here in an hour if it helps. I contacted host support but theyve been rather slow so I figure it may be easier for me to try and resolve it.

Added the .htaccess from the "/blog/" subdirectory below.

# 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

Can you post up a copy of your .htaccess file?

EDIT:

Set both WordPress Address (URL) and Site Address (URL) to http://www.crowdwifi.co.uk if that doesn't work then try changing your htaccess to this as well:

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

# END WordPress

Have you checked your Front page settings are not pointing to a specific page?

  • Dashboard => Settings => Reading => A static page (select below) => Front page

Have you also checked your General Settings do not have the wrong URL?

  • Dashboard => Settings => General => WordPress Address (URL)
  • Dashboard => Settings => General => Site Address (URL)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM