Redirecting http traffic to https site using .htaccess file
In order to redirect access from http to https, you must first setup both a http and https host with the same host name.
- Create a .htaccess file using the MAMP PRO Editor and save this file in your document root.
- Add the following lines to your .htaccess file.
<ifmodule mod_rewrite.c="">
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</ifmodule>