dimanche 21 juillet 2019

How to avoid redirect to public_html in .htaccess?

I have set few redirect rules in .htaccess and now my website redirect everything to https://example.com/public_html (instead of just https://example.com), which returns a 404 not found error.

This is the .htaccess file:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(?:www.)?example\.com [NC]
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://example.com/$1 [R=301,L]
# Redirect www to non www
RewriteCond %{HTTP_HOST} ^www\.
RewriteRule ^(.*)$ https:/example.com/$1 [R=301,L]

How can I fix this?




Aucun commentaire:

Enregistrer un commentaire