In my Ubuntu server i have two vhosts, where each points the DocumentRoot for the folder and ServerName for the correct domain and sub domain. I have done it with example.com and sub.example.com, changed in my local hosts files and they working as expecte, so confgs files are working as expected.

But when i use my main domain with an wordpress installation and write down in the browser subdomain.mydomain.com it always redirect to the mydomain.com . I think should be something with wordpress, since i cannot reach my subdomain where i have a index.html simple file just to test. (In the future i will put another Wordpress instalation just for the sub domain, it´s a marketing campaign)

My htacess file in main domain is pretty straighforward

   # 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]

# END WordPress

I have already created my sub domain in DNS Record with A and the correct IP.

Any ideas? I was trying to avoid create a multisite...

Thanks in advance.

  • It's not clear to me from your question what you want to do. Maybe write a list in your question of speciifcally what Wordpress installations you have, and speciifically what domain and subdomains you want each Wordpress installation to work on. – mozboz Aug 3 at 17:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.