htaccess-www-to-non-www-ssl-example 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <IfModule mod_rewrite.c>
  2. <IfModule mod_negotiation.c>
  3. Options -MultiViews -Indexes
  4. </IfModule>
  5. # www -> non-www redirection - start
  6. RewriteEngine On
  7. RewriteCond %{HTTP_HOST} ^www\.iammgo\.com [NC]
  8. RewriteRule ^(.*)$ https://iammgo.com/$1 [L,R=301]
  9. # redirection - end
  10. RewriteRule ^(.*)$ public/$1 [L]
  11. # Handle Authorization Header
  12. RewriteCond %{HTTP:Authorization} .
  13. RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  14. # Redirect Trailing Slashes If Not A Folder...
  15. RewriteCond %{REQUEST_FILENAME} !-d
  16. RewriteCond %{REQUEST_URI} (.+)/$
  17. RewriteRule ^ %1 [L,R=301]
  18. # Send Requests To front Controller...
  19. RewriteCond %{REQUEST_FILENAME} !-d
  20. RewriteCond %{REQUEST_FILENAME} !-f
  21. RewriteRule ^ index.php [L]
  22. </IfModule>
  23. <IfModule mod_headers.c>
  24. Header always unset X-Frame-Options
  25. </IfModule>
  26. ###Start Kloxo PHP config Area
  27. ### begin content - please not remove this line
  28. #<IfModule mod_rewrite.c>
  29. # ## MR -- authentically for letsencrypt for webroot-based
  30. # RewriteRule /\.|^\.(?!well-known/) - [F]
  31. #</FilesMatch>
  32. ### MR -- using php version different with default php
  33. ### 1. Using suphp
  34. ### - Copy between '#<FilesMatch \.php$>' to '#</FilesMatch>' and
  35. ### then remove '#' from '#<FilesMatch', '#</FilesMatch>' and one of '#SetHandler'
  36. #<FilesMatch \.php$>
  37. #SetHandler x-httpd-php
  38. #SetHandler x-httpd-php56
  39. #SetHandler x-httpd-php73
  40. #</FilesMatch>
  41. ### OR
  42. ### 2. Using fcgid
  43. ### - Copy from '#Options' to '#FCGIWrapper' and
  44. ### then remove '#' for one of '#FCGIWrapper'
  45. #Options +ExecCGI
  46. #<FilesMatch \.php$>
  47. # SetHandler fcgid-script
  48. #</FilesMatch>
  49. #FCGIWrapper /usr/bin/php-cgi .php
  50. #FCGIWrapper /usr/bin/php56m-cgi .php
  51. #FCGIWrapper /usr/bin/php73m-cgi .php
  52. ### end content - please not remove this line
  53. ###End Kloxo PHP config Area