[請益]CodeIgniter 開啟mod_rewrite失敗
已爬文但仍然無法解決,只好再發一篇請大家幫忙
環境
Win10
apache 2.4.20 x86
php 5.6.22 x86
CI2.1.2
架構
WWW
/test
/index.php、.htaccess、system、application...
修改項目
apache-httpd.conf
155行
LoadModule rewrite_module modules/mod_rewrite.so 刪除註解
226行
<Directory />
AllowOverride All
Require all denied
</Directory>
244行
<Directory "d:/www">
Options MultiViews
AllowOverride All
Require all granted
</Directory>
ci-conf
$config['index_page'] = '';
.htaccess內容
RewriteEngine On
RewriteBase /test
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
網路上查到的做法大都試過了,但是仍出現錯誤訊息
Forbidden
You don't have permission to access /test/index.php on this server.
麻煩大家看一下我有哪邊做錯了,感謝
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 118.232.112.210
※ 文章網址: https://www.ptt.cc/bbs/PHP/M.1468577678.A.3F3.html
→
07/15 21:06, , 1F
07/15 21:06, 1F
→
07/15 21:07, , 2F
07/15 21:07, 2F
→ MOONRAKERm: Sorry 沒看到在win10下 那恐怕跟CRLF沒關聯 07/15 21:08
推
07/15 21:10, , 3F
07/15 21:10, 3F
推
07/15 21:14, , 4F
07/15 21:14, 4F
→
07/15 21:15, , 5F
07/15 21:15, 5F
在網址裡加上index.php就正常顯示,但是拿掉就會出現沒有權限的訊息,會是Options MultiViews這設定問題嗎?
※ 編輯: arthas1107 (118.171.135.62), 07/15/2016 22:36:07
※ 編輯: arthas1107 (118.171.135.62), 07/15/2016 22:37:41
推
07/16 02:06, , 6F
07/16 02:06, 6F
→
07/16 02:07, , 7F
07/16 02:07, 7F
推
07/16 02:22, , 8F
07/16 02:22, 8F
推
07/16 02:27, , 9F
07/16 02:27, 9F
→
07/16 07:11, , 10F
07/16 07:11, 10F
因為是抓範例來研究的,提供者是用2,剛剛測試確實是權限問題
改成Options FollowSymLinks就可以了,感謝大家提供意見
※ 編輯: arthas1107 (118.232.112.210), 07/16/2016 15:39:32
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 3 篇):
PHP 近期熱門文章
PTT數位生活區 即時熱門文章