Home Subdomain is redirecting to folder under domain instead of staying as a subdomain
Reply: 0

Subdomain is redirecting to folder under domain instead of staying as a subdomain

user1996496
1#
user1996496 Published in 2018-02-10 04:53:28Z

I created the subdomain user.example.com but when accessing it, it redirects me to example.com/user. I can't seem to figure out why this is happening. I'm running Apache on CentOS with DirectAdmin.

Is it a .htaccess issue? Here is my .htaccess:

RewriteEngine On

RewriteCond %{HTTP_HOST} ^example.com [NC]
RewriteCond %{HTTP_HOST} !^user.example.com

RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301,NC]

RewriteBase /
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]

RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

Or an httpd.conf issue? Here is httpd.conf:

        ServerName www.user.example.com
        ServerAlias www.user.example.com user.example.com
        ServerAdmin webmaster@example.com
        DocumentRoot /home/admin/domains/example.com/public_html/user
        UseCanonicalName OFF
        <IfModule !mod_ruid2.c>
                SuexecUserGroup admin admin
        </IfModule>
        CustomLog /var/log/httpd/domains/example.com.user.bytes bytes
        CustomLog /var/log/httpd/domains/example.com.user.log combined
        ErrorLog /var/log/httpd/domains/example.com.user.error.log
        <Directory /home/admin/domains/example.com/public_html>
        </Directory>
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.305496 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO