HTACCESS - Subdomain

2

Does anyone know how to configure htaccess? I need it to work with the subdomain, and the main domain does not appear in the address bar when the subdomain is open. Ex how you are now:

  

[ link

My current htaccess is the code below:

RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\.site\.com\.br$ [NC]
RewriteRule ^(.*)$ https://www.site.com.br/$1 [L,R=301]
    
asked by anonymous 15.02.2017 / 12:39

1 answer

3

You will need to put this here in .htaccess of the subdomain folder:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^subdominio.site.com.br$ [OR]
RewriteCond %{HTTP_HOST} ^www.subdominio.site.com.br$
RewriteRule ^(.*)$ http://www.site.com.br/subdominio/$1 [P]

In the example I am considering that you have the subdominio folder in the root of the domain, then you can edit it according to the need.

    
15.02.2017 / 13:01