I am using Zend framework where i have nice looking url controllers. Following .htaccess is working but its making SEO to see us as four links for one page.
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R]
I need to do following fix using htaccess:
www.stackoverflow.com/nice-looking-url = https://www.stackoverflow.com/nice-looking-url
stackoverflow.com/nice-looking-url = https://www.stackoverflow.com/nice-looking-url
http://www.stackoverflow.com/nice-looking-url = https://www.stackoverflow.com/nice-looking-url
http://stackoverflow.com/nice-looking-url = https://www.stackoverflow.com/nice-looking-url
How to do it correctly using htaccess? so that above input urls are safely landing with https://www. in front always?
Have your full .htaccess like this:
Make sure to use a new browser to test your changes to avoid old browser cache.