Problems with . htaccess root folder and https redirect

Asked

Viewed 142 times

1

I have a problem here, I have no knowledge of .htaccess and I’m not getting it set up.

I need him to redirect the domain without www to the domain with www, an error is that it is redirecting all domains Https for http://meusite.com/meusite.com <-without the "s" at the end of the Https and root folder is not the default, but this occurs only when I type in to access Https.

While the right thing would be https://meusite.com, could pass me the codes to create the archive .htaccess?

I need the codes with the two items I mentioned and at the end the code for redirecting all Urls to access https to do some tests here.

Follow my code that’s not working:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^classificadosjs.com.br [NC]
RewriteRule (.*) https://www.classificadosjs.com.br/ [R,L]
RewriteCond %{HTTP_HOST} ^classificadosjs.com.br$ [NC,OR] 
RewriteCond %{HTTP_HOST} ^www.classificadosjs.com.br$ 
RewriteCond %{REQUEST_URI} !/home/classif3/public_html/classificadosjs.com.br/
RewriteRule (.*) /home/classif3/public_html/classificadosjs.com.br/$1 [L]
Options -Indexes
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html
RewriteCond %{REQUEST_URI} !^/home/classif3/public_html/classificadosjs.com.br/
RewriteRule ^(.*)$ /home/classif3/public_html/classificadosjs.com.br/$1 [L,R=301]
RewriteCond %{HTTPS_HOST} ^www.classificadosjs.com.br [NC]
RewriteRule ^(.*)$ https://www.classificadosjs.com.br/$1 [R,L]

Note: I don’t know if I should put RewriteEngine off in the end? In the case I put and did not work anything else, sorry I am very unaware in the subject.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.