apache - How can I create a .htaccess file that 301 redirects to HTTPS, redirects trailing slash from end of URL to non and removes .php without conflicts? -


i have been trying hours create .htaccess file without luck.

i have redeveloped site , seo bit on place. google's , users' sake, need .htaccess file that:

  • redirects http://example.com/* https://example.com/*
  • redirects *.example.com/*.php https://example.com/*
  • redirects *.example.com/*/ https://example.com/*

so clarify, forces ssl, removes trailing slashes , .php extensions in google friendly (301-redirect) way. or combination of above.

this should - listed cases

redirect permanent / https://secure.example.com/ 

ref: https://wiki.apache.org/httpd/redirectssl


Comments