###前提・実現したいこと
cakephpで作られ稼動しているサイトがあります。
ssl化で、http:をhttps:に書き換えるため、.htaccessを書きました。
http://example.net/*
https://example.net/*
に書き換えたいです。
###発生している問題・エラーメッセージ
トップページのみ
https://example.net/app/webroot/
となってしまい404となります。
https://example.net/
にしたいです。
https://example.net/とurlを入れてもhttps://example.net/app/webroot/になります。
他のページは希望通りになっています。
###該当のソースコード
app>webroot>.htaccess
<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?url=$1 [QSA] RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R,L] </IfModule>
###試したこと
C:\example.net\app.htaccess:
<IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^$ webroot/ [L] RewriteRule (.*) webroot/$1 [L] </IfModule>
にも
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R,L]をいれたりしましたが、だめでした。
よろしくお願いします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/12/14 04:16