Configuration for nginx, add this code to /etc/nginx/conf.d/redirect.conf
#Nginx
server {
listen 80;
server_name example.com www.example.com;
return 301 https://$server_name$request_uri;
}
Configuration for APACHE, add this code to /etc/httpd/conf.d/redirect.conf
#Apache
<virtualhost *:80>
ServerName example.com
ServerAlias www.example.com
Redirect / https://example.com/
</virtualhost>
Comments
Post a Comment