Trying to visit URL without www. causes WordPress to try and load the non-existent /defaultsite page

If I try to navigate to http://vequityintelligence.co.uk then WordPress redirects the browser (301 Moved Permanently) to http://www.vequityintelligence.co.uk/defaultsite which doesn’t exist, so I get a 404 Not Found error.

  • The htaccess file is the one that came with WordPress.
  • I’ve refreshed my permalinks by changing the permalink format.
  • The site frontpage is set to the ‘Recent Posts’ option, but changing this doesn’t affect it.

I understand why I get redirected, but I don’t understand where the addition of ‘/defaultsite’ comes from.

Read More

I have searched google and SO with very few results, let alone any answers. I can’t think what else might cause this.

Related posts

Leave a Reply

3 comments

  1. I imagine you don’t need this answer anymore, but adding it for posterity: weird as it sounds, I think it’s a caching issue.

    I just came across this with a client’s site I’m working on, and was at my wit’s end, but then found some references that said it worked okay in one browser but not another, and clearing the cache fixed it.

    An easy test: if you visit the URL in a browser you’ve never used to visit it, do you still have the issue? If not, it’s probably just a matter of clearing the cache in the browser that is giving you trouble.

  2. In the WordPress dashboard > General Settings, check your setting for the WordPress Address (URL) and Site Address (URL).

    This is where I made sure the ‘www.’ was unnecessary for my URL.

  3. I’d say it’s a problem with the htaccess file. Perhaps adding the following code to htaccess will resolve the problem.

    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^www.
    RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
    

    This redirects non-www to www. Put this near the top so it is processed before other rules are.

    Code found here