There is a site, there is a front that is backing up on http. Is it possible, like it is not tricky and quickly, to make an admin panel on a secure https? Site on php

  • What's the problem? Simple redirect, no? - neoascetic

2 answers 2

Actually you just need to configure the web server, you do not need to rewrite anything. I still recommend to find out what HTTPS is.

    The transition to the secure HTTPS protocol is done at the web server level.

    If you are using Nginx, it is better to use the return directive state_code url. The redirection is best done at the location level so that robots.txt and sitemap.xml files remain accessible to search engines. Context with http:

     server {
       listen 80;
    
       server_name domain.tld;
       server_name www.domain.tld;
    
       location ^ / robots.txt {
         try_files $ uri = 404;
       }
       location ^ / sitemap.xml {
         try_files $ uri = 404;
       }
    
       location / {
         return 301 https: //www.domain.tld$request_uri;
       }
     }
    

    Within the context of http, it is desirable to enable compression:

     gzip on;
     gzip_types text / plain text / css application / json application / x javascript text / xml application / xml application / xml + rss text / javascript;
     gzip_disable "msie6";
    

    You can also help the article Nginx. Switch from http to https .