Installing WordPress Without WordPress in the URL
I wanted to get the website up quickly, so I decided to use WordPress and make it as secure as possible. I later intend to build a website from scratch or possibly use Drupal (which is similar to WordPress but more secure). There are a lot of big companies that also use WordPress, like BBC America, Bloomberg Professional, Sony Music, Microsoft News, Tech Crunch, and The Walt Disney Company to name a few, so maybe it isn’t as insecure as I might think.
Setting up WordPress is pretty easy, customizing it is a bit more difficult, but much faster than building one and much less expensive than having somebody else build you one. So if you want a quick professional looking website, WordPress is probably the way to go.
Some things to realize if you are totally new to WordPress. WordPress is open source, so it can be used and modified freely. You can even sale WordPress if you could find somebody to buy it. Since it is open source all the themes, plugins etc., that people make to work with WordPress are also open source. They can charge you for them, but once you buy them you are free to do what you want with them, according to the GPLv2, GNU Public License, with possibly the exception to using some of the css and javascript,. That probably doesn’t mean much to the average person, since they would not be modifying them or selling them, but it could mean that you only need to buy a theme or plugin once to use it on several websites. Of course, there are many very good themes and plugins available for free. Please do remember that programming anything usually takes a lot of work, and the worker is worthy of his pay.
Another thing to note is that WordPress.org and WordPress.com are actually different. WordPress.org is where you can get WordPress for free if you are using a separate hosting provider. I would definitely suggest that option if you want to host a website. You have more control and it will probably turn out much cheaper. The other option is to use WordPress.com, and they will host the site for you. I am pretty sure that on WordPress.com you can still get a free site, but it is pretty limited. We used it in college as a weekly journal, but it was not very pretty. They also host paid sites that are much better. I think you can still use the default wordpress.com site with a subdomain of your choosing, but if you are putting up a site for something more than a journal or something similar, you will need to get a domain name. A lot of places sale domain names and you don’t have to buy the domain name from your hosting provider, although it is a lot easier, in many ways, to keep everything together.
HOW I INSTALLED WORDPRESS
Although you can get WordPress from the WordPress.org website, most hosting providers already have it ready and waiting to be installed from their service making it even easier. I use interServer to host my site and I installed WordPress using Softaculous Apps Installer available in the CPanel. It installed very easily. Just one little glitch that I will mention. When installing WordPress be sure to leave the WordPress Address (URL) as the default, but you will want to change the Site Address (URL) to your domain name. If you don’t then your site will have to be accessed with your domain followed by /wordpress or /wp. It will look something like www.yoursite.com/wordpress or www.yoursite.com/wp. You don’t want to go through all the trouble to get your own domain and your own hosting and then have to use wordpress in your URL. It is annoying and a bit unprofessional looking. The installation is done. If you forget to change the site URL when installing, you should still be able to do it after.
CHANGING THE SITE URL AFTER INSTALLATION (only if you didn’t change it during install)
Just be sure to do it before you start customizing your site, because it becomes a lot of trouble later. If you need to do it after install go to the Dashboard. If your site pulls up with a left panel that says “You are customizing YourSiteName” then click the X that is just above that on the left. Doing so should take you to the Dashboard. If it doesn’t, and it takes you to what looks like yoursite in progress; look at the top left and you should see some links. Click the link that has your sitename, and dashboard should be in the drop down menu.
Now that you are in the Dashboard, click Settings (on the left side menu), in General Settings find Site Address (URL) and enter your site’s domain name. Exp. https://yoursitename.com. Leave the WordPress Address (URL) how it is. You will edit your site through that URL with “/admin” at the end. Now your site should be viewable through your domain name without “/wordpress” or “/wp” at the end. Unfortunately, if you have already started to customize or add content, you are probably getting “404 Your Content Cannot Be Found” errors on you pages. You may get a blank page with the 404 error or you may get a page that has part of your stuff and contains a 404 error in the body. If so, you will need to take some additional steps. This happened to me and it is NOT FUN.
IF YOU NEED TO TAKE /wordpress or /wp OUT OF THE URL AND YOU HAVE ALREADY STARTED TO CUSTOMIZE
I googled for the answer and found a lot of different things, none of which worked. I finally found something that almost worked, or worked with modification. I actually came upon this site, https://wordpress.org/support/article/giving-wordpress-its-own-directory/,at the very first, but thought it didn’t pertain to what I needed. It actually did pertain, but in a backwards sort of way.
Here is what I did and hopefully, it will work for you too.
Follow the directions from the above section “Changing the Site URL After Installation”. Then open the link https://wordpress.org/support/article/giving-wordpress-its-own-directory/ in a separate window so you can see it, and these instructions at the same time. You will also need to have the cpanel open on your host provider, preferably in another window. Just arrange the 3 windows so you can see them all.
In the linked website, go the heading Method I (Without URL change). You don’t need to do the part that says move everything from the root folder into a subdirectory, because it is already in its own directory (that’s the problem). So go to 2). You can create the .htaccess file on your computer in notepad and upload it using cpanel. Note: You can just create it in cpanel, but doing it on the computer will give you a copy to refer back to if needed. Just open Notepad (not MS Word or other word processor, as it may apply unwanted formatting to the text), copy the following text and paste into Notepad.
Example:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?yourdomain.com$
RewriteCond %{REQUEST_URI} !^/wp/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /wp/$1
RewriteCond %{HTTP_HOST} ^(www.)?yourdomain.com$
RewriteRule ^(/)?$ wp/index.php [L]
Change yourdomain.com to the name of your domain, leaving the question marks and dollar signs; just change the name. Then my_subdir will be changed to wordpress or wp, whichever was used in the Site Address URL before you changed it.
Now save it from Notepad as .htaccess without any other extentsion such as .txt. You can do this by selecting All Files from the Save As Type drop-down. Don’t forget the dot before htaccess. Now use cpanel to upload the .htaccess file into yourdomains root directory (not the same as your home root directory). Your domains root directory may be under the Home root directory or it may be in Public_html. I know the linked site says “That’s all”, but it’s not. Now go to the heading Method II (With URL change). Skip step 1. and go to step 2-5. If you have not already done this, do it now. Skip step 6. (files are already in a subdirectory). Go to step 7 and follow the instructions for the index.php file. Don’t do anything for the .htaccess file because we need the .htaccess file that we already created, not the one from the subdirectory. Repeat only copy the index.php file from the subdirectory to the root directory. Do nothing with the .htaccess file, we already created one in the root directory. On to step 8. Just use cpanel to edit the index.php file that we just copied to the root directory (you still have the original in the subdirectory if you mess up). Note: it says to change it to /wordpress/wp-blog-header.php, but if your Site URL in settings had /wp you will change it to /wp/wp-blog-header.php. Step 10 says login to your new location. It is referring to your admin location and it will still be the same, either http://YourDomain.com/worpress/admin or http://YourDomain.com/wp/admin. Your new site URL will be http://YourDomain.com. Make sure you can access both of them. Now go to step 11 and set up your permalinks. If have already set up permalinks, do it again as it resets your new URL. In permalinks, you will probably want to click the Post name radio button unless you have a good reason to use on of the others. The Post name option will make it easier to find specific posts later.
Now WordPress should be installed and your site should be accessible using only your domain name.