| > |
PHPFAQ - How can I redirect all http (non-secure port 80) requests to https (Secure port 443) |
[Bookmark it] |
|
|
| PHPFAQ - How can I redirect all http (non-secure port 80) requests to https (Secure port 443) |
|
Question : How can I redirect all http (non-secure port 80) requests to https (Secure port 443)Answer :You can use the .htaccess method using mod_rewrite as follows
RewriteEngine on
RewriteCond %{SERVER_PORT} =80
RewriteRule ^(.*) https://%{SERVER_NAME}%{REQUEST_URI}
Any good webhost will have mod_rewrite installed and allow .htaccess files.
|
|
|
|
|
|
|