Have you ever encountered the 404 error when uploading a HTML page to your WordPress website? It is likely that you need add the static HTML page to your site, and make the page accessible within your WordPress website as well. In below, we are going to illustrate how to correctly upload the HTML page to your site without leading to any 404 error.
Why Need You Upload a HTML Page to WordPress?
There is content type built in WordPress, specially created for adding pages to your WordPress site. Normally, WordPress themes come with pre-designed page layouts or templates for users to display their pages quickly and easily.
What’s more, there are many landing page plugins for WordPress outside, which can help you create stunning page templates by using a drag-and-drop builder.
Therefore, in most cases, you have no need to upload HTML pages to your site with these functions or WordPress plugins.
Nevertheless, sometimes you probably have those static HTML pages from existing or old sites, or a static template which you are really fond of and desire to use. In those scenarios, you will be required to upload your existing HTML pages to your new WordPress site.
By default, WordPress includes its own SEO-friendly URL structure, which is able to lead to 404 errors if you just upload your HTML pages as well as attempted to access that page.
Now, let’s start to check out the way of uploading your HTML page to your WordPress website without even causing a 404 error.
Upload a HTML Page to Your WordPress Site
Before starting to upload the HTML page to your WordPress website, you need ensure that the “index.html” file is indeed renamed as “index.php” file.
Next, you just need add all your files including CSS, HTML pages, as well as other file folders to one Zip archive.
For those Windows users, you can just right click and then choose the option of “Send to” >> “Compressed Zip Folder” to build up a new zip file. Then, you need drag and drop your files as well as folders for your HTML pages to that zip file just created.
For Mac users, you simply need select the parent file folder which includes all folders and files. After that, you just need right click and then choose “Compress ‘template’” folder option.
Then, you can visit your cPanel account in WordPress, and in the control panel, you need scroll down to “Files” section. In this area, you need click on “File Manager” option located in the beginning.
Now, you should be in the “File Manager”. Your WordPress site root folder is usually named as “public_html” and the folder includes every WordPress files folder of yours. Here in the “File Manager”, you just need navigate to your site root folder. In the folder, you need click on the “Folder” link you can find in the top menu and it will allow you to build up a new empty file folder.
When you are creating a new folder, there will be a popup opened to you. On the popup, you are required to give a name for this new folder. Note that the folder’s name is the one you like to use as the HTML page’s URL. Then, you can click on “Create New Folder” button to create the one folder.
Once the new folder is created successfully, you can open it and then click on “Upload” button in the top menu as well to choose and then upload the zip file just created from your device. Now, you can see there is a progress bar when the zip file is uploading to your website.
Next, you can choose the zip file and click on “Extract” from the top menu.
Then, you need to choose where to extract that file. You can simply choose the same new folder you just created and then press that “Extract File(s)” button.
Now, the file manager in your cPanel control panel will extract that zip file and you can see the files in that zip folder as well.
Remember that you can directly delete this zip file here, which will not affect your HTML pages or other folders which are extracted.
At present, you can use the folder’s name as the pages’ URL to view the page in your browser. If your web server does not support this redirection, then you could get a 404 error in the page. How does it happen? It is because that your “index.php” file isn’t redirected on the loading that page’s URL in your browser.
Don’t worry! The 404 error is not serious but very common one in WordPress, so it is easy to fix it.
Head over to the “File Manager” app in your cPanel account in WordPress. You need use the app to edit the .htaccess file located in your site root folder, and then add this code below in the folder:
Actually, this code can redirect the “index.php” file as well as load it in your browser. If you choose to use a case-sensitive folder name, then that code above can also redirect that file to display the content for you. That’s all, and you will have no any 404 error showing on your page any more.
In this guide, we have talked about how to upload your HTML page to your WordPress website without causing any 404 error. You can try this way to test if it is good for your online business. Hope you can apply this way smoothly by following our guide. If you need more tips or guides about running WordPress websites, please check out our WordPress Tutorials.