Moving wordpress site to a subfolder of the domain

Hellow there fellow wordpressers.

I have in hands the task of setting up a wordpress site for students to work on and mess stuf in order to make some official sites we need, so when the site is finished it will eventually be moved to the real site.

Because of that we want to “hide” the website in a subfolder of the domain, so for example domain.edu points to a unassuming plain index.html to dissuade people, while domain.edu/wp-devel is our wordpress site

So far here is the file structure:

NOTE:

Root of the apache webserver is moved to /srv/http instead of /var/www and we are using a server I have full physical access running debian 11 with both apache and wordpress coming from the repos.

/srv/http/
index.html #the unsassuming webpage
wordpress/
wp-content/
#all the wordpress stuff

and the respective sites configs:

unassuming.conf:

<VirtualHost *:80>

ServerName domain.edu

ServerAdmin webmaster@localhost
DocumentRoot /srv/http

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

wordpress.conf:

<VirtualHost *:80>
ServerName domain.edu

ServerAdmin [email protected]
DocumentRoot /usr/share/wordpress

Alias /wp-content /srv/http/wordpress/wp-content
<Directory /usr/share/wordpress>
Options FollowSymLinks
AllowOverride Limit Options FileInfo
DirectoryIndex index.php
Require all granted
</Directory>
<Directory /srv/http/wordpress/wp-content>
Options FollowSymLinks
Require all granted
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

thanks in advance.

1 Comment
  1. You could just remove the wordpress.conf, and the site will be accessible via [domain.edu/wordpress]).

    If you don’t want people seeing the site, install a “coming soon” plugin like “CMP”

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer