jeudi 1 août 2019

Redirect to no-www

sorry i searched but dont find my solution I have a laravel project on my host located in a folder www, in this folder there are all the files of the application and my .htaccess file, I would like that all the links: http://www... are redirected to http://... (without www) because I have problems with google.

Here is the content of my .htaccess file

    RewriteEngine On

        ## www -> no-www
    RewriteCond %{HTTP_HOST} ^www\.(.+)$ 
    RewriteRule ^ https://%1%{REQUEST_URI} [R=301,L,NE,QSA]
        ## http -> https
    RewriteCond %{HTTPS} off
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,NE,QSA]

but it does not work, if I go to my site with both urls, I have no redirection




Aucun commentaire:

Enregistrer un commentaire