準備したこと
- ApacheのDocumentRoot(/var/www/html)にシンボリックリンクを設置
site-link -> /var/www/site/public (laravelのpublic) - Apacheのhttpd.conf
<Directory "/var/www/html”>
Options Indexes FollowSymLinks
AllowOverride None
.
.
</Directory>
<IfModule rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/?(.*)$ /site-link/$1 [L]
</IfModule>
サイトへのアクセス
http://xxxxxx/helo
結果
ページが見つからない
試したこと
<IfModule rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/?(.)$ /site-link/index.php/$1 [L]
</IfModule>
質問
RewriteRule ^/?(.)$ /site-link/index.php/$1 [L]
何故、上記のようにindex.phpを追加するとアクセスできるのでしょうか?。
自己解決
解決しました。
なんと申し訳ございませんでした。
Rewriteでループしていました。
解決方法はRewritCondを追加しました。
RewriteCond %{REQUEST_FILENAME} ! ^/site-link/
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。