0
Where my site is hosted, I am using the . htaccess and on it has a condition to remove the www and direct to the main page without the www.
<ifModule mod_rewrite.c>
Header set X-Frame-Options DENY
RewriteEngine On
# Required to allow direct-linking of pages so they can be processed by Angular
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !index
RewriteRule (.*) index.html [L]
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.*)
RewriteRule (.*) http://meusite.com.br [R=301,L]
</ifModule>
The problem is this, when someone accesses an internal page with www, it falls for this check and is directed to the home, example:
If someone accesses the link: http://www.meusitecom.br/conteudo/94-vai-criar-um-site-para-a-sua-empresa-saiba-o-que-nao-pode-faltar
It will direct to http://meusite.com.br as per condition.
What I need is to be directed to the following link: http://meusitecom.br/conteudo/94-vai-criar-um-site-para-a-sua-empresa-saiba-o-que-nao-pode-faltar just removing the www from the link.
Does anyone know if there is a possibility of this verification being done in . htaccess?
Remembering that when accessing the internal with www, need to be removed only www and not redirected to the home.
Possible duplicate of Force Urls with www. to without www. com htaccess
– Bacco