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

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