Change url via .HTACCES

0

Sehores, good afternoon. I need to change my homepage to be a subfolder. I added the following code in my .htaccess file, but only worked for url without www , ex: dominio.com.br , redirects to dominio.com.br/webstore (correct redirect). If you type www.dominio.com.br , redirection does not work. What I edited was:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^dominio.com.br$ [NC,OR]
RewriteCond %{HTTP_HOST} ^dominio.com.br$
RewriteCond %{REQUEST_URI} !webstore/
RewriteRule (.*) /webstore/$1 [L]

What should I do to make the url containing www also be redirected?

    
asked by anonymous 29.05.2017 / 21:45

1 answer

0

Hello, it's simple, just put the www being optional in the condition. Example:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?dominio.com.br$
RewriteCond %{REQUEST_URI} !webstore/
RewriteRule (.*) /webstore/$1 [L]
    
29.05.2017 / 21:56