How to?

How to Redirect 404 Not Found Page Using .htaccess

Recently, I moving one of my website from WordPress CMS to normal static html. I found out that there are too many 404 not found errors.

One of the solutions is to redirect it to more meaningful page, especially the Homepage. Although some people may argue, the usefulness of the redirects. However, I prefer to do so on some of my websites.

To do this I need to edit “.htaccess” which located at the root folder of the particular website. If you are unable to see the file, make sure you allow to view hidden files since “.htaccess” is a hidden file. If it still not there, then create it.

The following procedure, guides on how to redirect.

  1. If you are using cPanel, log into front-end and click on “File Manager” application. Make sure you enable the hidden file viewers.
  2. Go to the root folder of the website & edit or create “.htaccess” file.
  3. Add the following code & replace YOURURL with the URL where you want the error 404 page redirected to.
  4. Click save & you are done.
ErrorDocument 404 http://YOURURL

How to Install cPanel/WHM on CentOS VPS

cPanel/WHM installation on your VPS or dedicated server is very easy. Just follow the steps below & you are done. Remember that you need fresh CentOS installation prior to installing cPanel/WHM.

1. Run your preferred SSH client such PuTTY. Connect to your server & login as “root”.

2. Download & install cPanel/WHM by running the following commands one by one.

cd /home
wget -N http://httpupdate.cpanel.net/latest
sh latest

The process will take approximately 60 to 90 minutes but it is largely depending on your server internet connection and performance.

If you only want to install cPanel DNSONLY version use the following command instead

cd /home
wget -N http://httpupdate.cpanel.net/latest-dnsonly
sh latest-dnsonly

Once the installation complete, login to your WHM as root to configure,

http://yourip:2086 or

https://yourip:2087