0
I have the following subdomain: http://projectos.sitecom.br. How I would make the user when typing: www.site.com.br/projects, was redirected to the given subdomain? I created inside the directory projects the following rule in .htaccess:
RewriteEngine On
RewriteCond %{HTTP_HOST} www.site.com.br/projetos
RewriteRule ^(.*)$ http://projetos.site.com.br/$1 [L]
But it didn’t work! In Cpanel I can redirect the subdomain to another directory, but not the other way around. I don’t know much htaccess. I tried that way too:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^site.com.br/projetos$
RewriteRule (.*) http://projetos.site.com.br/$1 [R=301,L]
and
RewriteEngine on
RewriteCond %{HTTP_HOST} ^site.com.br/projetos$ [OR]
RewriteCond %{HTTP_HOST} ^www.site.com.br/projetos$
RewriteRule ^/?$ http://projetos.site.com.br/ [R=301,L]
But they didn’t work either! I put htaccess in the root folder and nothing!