Subdomain redirect to main domain

I created subdomain But it’s redirect to main domain. For Example : my domain name is mydomain.com and I created subdomain test.mydomain.com But issue is that When open subdomain url it’s always redirect to mydomain.com. I want to stop this redirection. Here is .htaccess file text.

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

Related posts

1 comment

  1. I had the same issue and solved it with this as my .htaccess file text:

    Options +FollowSymlinks
    Options -Indexes
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} ^www.(.*)$ [NC]
    RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
    

Comments are closed.