Wordpress 404 on Subdomain
I have taken a copy of my Wordpress website and set up a subdomain, and virtual host (/var/www/subdomain/) on the existing websites server. After moving the copy of the website I am getting a 404 error on all pages except the Home Page and WP Admin area.
Apache Conf file below;
VirtualHost *:80
ServerName subdomain.example.com
ServerAlias subdomain.example.com
DocumentRoot /var/www/subdomain
RewriteEngine on
RewriteCond %{SERVER_NAME} =subdomain.example.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
/VirtualHost
Edited
Also below is the SSL Cert apache conf
IfModule mod_ssl.c
VirtualHost *:443
ServerName subdomain.example.com
ServerAlias subdomain.example.com
DocumentRoot /var/www/subdomain
SSLCertificateFile /certfile/directory/
SSLCertificateKeyFile /certfile/directory/
Include /certfile/directory/
/VirtualHost
/IfModule
I have ensured the htaccess file is present, site url and home url are updated and resaved the permalinks, but the 404 error is still happening. I have also tried disabling plugins to make sure nothing was clashing
HTACCESS File below;
# BEGIN WordPress
IfModule mod_rewrite.c
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
/IfModule
# END WordPress
The existing Wordpress website on the server (/var/www/html/) is working fine and has no errors.
Any suggestions on things I might have missed / not set up correctly would be greatly appreciated.
Thank you