CloudPanel: How to Install WordPress On Subdirectory

Do you want to install a WordPress blog on the website subdirectory on CloudPanel?

Companies, Online services, freelancers, and Resume CV websites install their blogs on subdirectories like It helps them to display the main interactive HTML web pages on the homepage and keep a good blog on the subdirectory.

In this article, we will show you how to install WordPress on the CloudPanel site subdirectory.

Why do you have to install WordPress on the Website subdirectory?

If you have a company or freelance website, your front page needs to be an interactive and informative one, then you have to use HTML pages. Because you can design and add information whatever you want in HTML pages and easily hosted on your website hosting account.

It also increases website homepage speed and gives a good page score in the Google page speed test.

Let’s take a look at how to install WordPress on the subdirectory.

Add a Site as a PHP Application

The CloudPanel does not allow users to directly install apps on a subdirectory. First, you have to create an environment to run an app.

Add your site as a PHP application. It will add a PHP MySql environment. So you can create and use MySql databases.

CloudPanel add PHP site

Then navigate to sites File Manager. Delete the “index.php” file and create a folder named “blog”.

CloudPanel create subdirectory

Download WordPress software from the official site. Extract the zip folder and add the WordPress files inside /blog directory.

In the Database section, create a database for your WordPress blog.

CloudPanel create Mysql database

Now navigate to the subdirectory and install WordPress.

 install WordPress manually

After you log into the WordPress dashboard, you will find out some plugin setting pages broken.

CloudPanel broken WordPress

It happened because you have to add additional settings like adding the following command in vhost.

CloudPanel Vhost


 location /blog/ {
try_files $uri $uri/ /blog/index.php?$args;
index index.htm index.php;
include fastcgi_params;
fastcgi_intercept_errors on;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_read_timeout 3600;
fastcgi_send_timeout 3600;
fastcgi_param HTTPS "on";
fastcgi_param SERVER_PORT 443;
fastcgi_param PHP_VALUE "{{php_settings}}";

location ~* ^.+\.(css|js|jpg|jpeg|gif|png|ico|gz|svg|svgz|ttf|otf|woff|woff2|eot|mp4|ogg|ogv|webm|webp|zip|swf|map)$ {
add_header Access-Control-Allow-Origin "*";
expires max;
access_log off;

Note: CloudPanel uses Nginx server. So WordPress does not create a .htaccess file. If you want to add any .htaccess rule, you have to convert the rule to vhost code using htaccess to nginx converter. Then add the code in Vhost tab.

That’s all. Now you can check your blog. Everything will work as normal.

We hope this article helped you to learn how to install WordPress On Subdirectory in CloudPanel. You may also want to see our guide on how to move your WordPress blog to new hosting or our expert guide for how to install CloudPanel on Vultr hosting.

About The Author

Scroll to Top