My website is rewriting all subdomain links with www. for example
news.example.com
works fine, but if I go to
news.example.com/wp-admin
it will rewrite the URL to
www.example.com/wp-admin
This also happens if you click any links on the site, rather than going to the link you would expect it erases the sub domain portion and replaces with www., None of the images or css is loading also, I assume this is also because of the same issue.
My site is setup on amazon ec2 with elastic IP, I am using NameVirtualHost to separate out the domains via apache. The top level domain is the website running on laravel framework and the sub domain is a wordpress install. I will post my httpd.conf, it might help
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin webmaster@example.com
DocumentRoot "/var/www/html/website1_folder"
ServerName example.com
ErrorLog "logs/example.com-error_log"
CustomLog "logs/example.com-access_log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@example.com
DocumentRoot "/var/www/html/website2_folder"
ServerName subdomain.example.com
ErrorLog "logs/example.com-error_log"
CustomLog "logs/example.com-access_log" common
</VirtualHost>