WordPress Admin Page Not Found After Switching Hosting
I have been trying to get my admin page to work on my WordPress site for over a month, and it has finally occurred to me that I cannot get the page to load because of one simple mistake: the URL of my admin page points to the wrong place!
The mistake is entirely my own and is the result of an error when I was setting up the site. I thought, “Oh, no, what if someone clicks on a link in a forum and lands on my admin page?” Well, that someone might indeed find that page, and it would not be pretty!
What is that person going to think when she lands on a page that looks like this?
I should have seen this coming. I had switched web hosts, and the new host did not allow for the same kind of configuration as the old one. In other words, I had no idea what I was doing, and it showed. When I logged into WordPress, I was not greeted by the familiar grey screen but instead by a completely white screen!
After a while, I figured out that I needed to add some lines to my.htaccess file in order to get back the functionality that the new host provided. That was way more effort than it should have been, and it wasted a lot of time.
The Correct URL Structure
Looking back, I should have paid more attention to the advice that I regularly got from WordPress support: always use a trailing slash on directories and a full URL on posts and pages. So, if my admin page is in fact in indeed in /wp-admin, then I should have written /wp-admin/ in my URL to make sure that I was going to the right place. Instead, I got the default WordPress structure, which is /wp-admin.
The reason that it is important to use the correct URL structure is that search engines like Google are starting to notice when sites are built without it. When I entered my site into the Google search bar, this is what came up:
A Few Google Hits
I did indeed get some traffic from Google, but it was not nearly what I was expecting. I was expecting to see my site show up right at the top of the search results, but instead I saw this:
Not So Perfect
It turns out that even though Google said that my site was “authoritive” for the search query “wordpress hosting,” there was still a lot of competition out there. My competitor’s sites came up first and showed a lot of pictures of food, followed by a short description of the product and a link to their website. So, even though my site was technically “authoritive,” it did not have the perfect user experience that I was looking for.
Here are some important things that I learned from this experience:
Use a trailing slash on directories: Directories such as /wp-admin are common entry points to your WordPress admin area and are therefore considered “catch-all” directories. When a user browses to a directory without a trailing slash, the browser may try to access a file called “index.php” in the directory, which could potentially lead to unauthorized access. When directories have a trailing slash, the browser knows that it is supposed to look for files inside of it.
Use a full URL on posts and pages: When a user wants to visit a specific piece of content on your website (e.g., the home page, an article, etc.), she will type the URL for that content into the browser bar. However, if the URL for the content is missing a couple of key parts (e.g., www.mysite.com/path/to/post or www.mysite.com/page), search engines like Google may disregard the link as “unreliable” and potentially even block it from showing up in search results. This could potentially hurt the traffic that you are getting from search engines.
Make sure that your.htaccess file is correct: The htaccess file is a configuration file that is located in the root directory of your website. If you are not sure where this is, then you can find out by looking at the file itself—it will be named.htaccess. This file controls various aspects of your site’s performance, most notably the security settings and the caching functionality.
You should try to have a trailing slash on all directories and a full URL on all posts and pages. These are simple things to do, and they will make a world of difference for your WordPress site’s performance.