Skip to content

Instantly share code, notes, and snippets.

@NorihikoMoriyama
Last active December 23, 2015 05:49
Show Gist options
  • Save NorihikoMoriyama/6589219 to your computer and use it in GitHub Desktop.
Save NorihikoMoriyama/6589219 to your computer and use it in GitHub Desktop.
強制的にURLをhttpsに変更します。[.htaccess][cakephp]
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /***/
RewriteCond %{SERVER_PORT} !^443$
RewriteCond %{REQUEST_URI} !^(.*\.(jpg|gif|png|jpeg|js|css))$ [NC]
RewriteRule ^(.*)?$ https://%{HTTP_HOST}/***/$1 [L,R]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment