我使用了很多tuttorials,但都導致我出現同樣的錯誤 - 錯誤500 - 服務器超載或CGI腳本中出現錯誤。在Yii中編寫好的網址
我在Windows上使用XAMPP和cofigured httpd.conf中這樣
<Directory />
Options FollowSymLinks
AllowOverride All
Order deny,allow
Allow from all
</Directory>
在警予main.php
'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=>false,
'caseSensitive'=>false,
'rules'=>array(
'' => 'site/index',
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
),
),
改變,在根文件夾(在同一水平,添加的.htaccess受保護的文件夾)
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on
RewriteBase /tests/
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php
但不管如何我在.htaccess寫,我得到這個錯誤。當我評論全部,yii鏈接生成好(沒有index.php),但然後我有404錯誤,因爲錯誤的服務器配置。
編輯:
和error.log最後幾個記錄:
[週三11年11月27日:32:31.100063 2013] [核心:警報] [PID 9520:TID 1572] [客戶:: 1:58620] C:/Users/kristineg/xamps/htdocs/xampp/tests/.htaccess:此處不允許使用此選項 [Wed Nov 27 11:32:31.372163 2013] [core:alert] [pid 9520: tid 1572] [client :: 1:58621] C:/Users/kristineg/xamps/htdocs/xampp/tests/.htaccess:此處不允許選項 [Wed Nov 27 11:32:34.674379 2013] [core:alert] [pid 9520:tid 1572] [client :: 1:5862 2] C:/Users/kristineg/xamps/htdocs/xampp/tests/.htaccess:此處不允許的選項 [Wed Nov 27 11:32:36.587084 2013] [core:alert] [pid 9520:tid 1572] [client :: 1:58623] C:/Users/kristineg/xamps/htdocs/xampp/tests/.htaccess:這裏不允許選項 [Wed Nov 27 11:32:54.899832 2013] [core:alert] [pid 9520:tid 1572] [client :: 1:58624] C:/Users/kristineg/xamps/htdocs/xampp/tests/.htaccess:此處不允許的選項 [Wed Nov 27 11:54:14.056192 2013] [core:alert] [ pid 9520:tid 1572] [client :: 1:59297] C:/Users/kristineg/xamps/htdocs/xampp/tests/.htaccess:此處不允許的選項 [Wed Nov 27 11:54:14.687425 2013] [core :alert] [pid 9520:tid 1572] [client :: 1:59298] C:/Users/kristineg/xamps/htdocs/xampp/tests/.htaccess:此處不允許選項 [Wed Nov 27 15:53:27.459885 2013] [ssl:warn] [pid 11320:tid 308] AH01909:RSA certificate con計算www.example.com:443不包含與服務器名稱匹配的ID [Wed Nov 27 15:53:27.525911 2013] [core:warn] [pid 11320:tid 308] AH00098:pid文件C:/用戶/ kristineg/xamps/apache/logs/httpd.pid被覆蓋 - 以前的Apache運行不正常關閉? [Wed Nov 27 15:53:27.588934 2013] [ssl:warn] [pid 11320:tid 308] AH01909:爲www.example.com配置的RSA證書:443不包含與服務器名稱匹配的ID [Wed 11月27日15:53:27.625947 2013] [mpm_winnt:通知] [pid 11320:tid 308] AH00455:Apache/2.4.4(Win32)OpenSSL/1.0.1e PHP/5.5.1配置 - 恢復正常操作 [Wed 11月27日15:53:27.625947 2013年] [mpm_winnt:通知] [pid 11320:tid 308] AH00456:服務器內置:2013年2月23日12:42:00 [Wed Nov 27 15:53:27.625947 2013] [core:notice AH00094:命令行:'c:\ users \ kristineg \ xamps \ apache \ bin \ httpd.exe -d C:/ Users/kristineg/xamps/apache' [Wed Nov 27 15: 53:27.627948 2013] [mpm_winnt:通知] [pid 11320:tid 308] AH00418:父:創建子進程4472 [Wed Nov 27 15:53:27.998083 2013] [ssl:warn] [pid 447 2:tid 336] AH01909:爲www.example.com配置的RSA證書:443不包含與服務器名稱匹配的ID [Wed Nov 27 15:53:28.143138 2013] [ssl:warn] [pid 4472:tid 336] AH01909:爲www.example配置的RSA證書。com:443不包含與服務器名稱相匹配的ID [Wed Nov 27 15:53:28.186154 2013] [mpm_winnt:notice] [pid 4472:tid 336] AH00354:Child:啓動150個工作線程。 [Wed Nov 27 15:53:38.827074 2013] [core:alert] [pid 4472:tid 1640] [client :: 1:61797] C:/Users/kristineg/xamps/htdocs/xampp/tests/.htaccess:選項不允許在這裏 [Wed Nov 27 15:53:39.614364 2013] [core:alert] [pid 4472:tid 1652] [client :: 1:61796] C:/ Users/kristineg/xamps/htdocs/xampp/tests /.htaccess:此處不允許使用選項 [Wed Nov 27 15:53:39.958491 2013] [core:alert] [pid 4472:tid 1640] [client :: 1:61798] C:/ Users/kristineg/xamps/htdocs /xampp/tests/.htaccess:這裏不允許的選項 [Wed Nov 27 15:53:40.295616 2013] [core:alert] [pid 4472:tid 1652] [client :: 1:61799] C:/ Users/kristineg /xamps/htdocs/xampp/tests/.htaccess:這裏不允許的選項 [Wed Nov 27 16:32:32.894114 2013] [core:alert] [pid 4472:tid 1640] [client :: 1:62407] C: /Users/kristineg/xamps/htdocs/xampp/tests/.htaccess:此處不允許使用此選項
取消註釋該行,重新啓動服務器並更改了.htaccess,但出現同樣的錯誤:( –
必須有其他錯誤,那麼您能檢查錯誤日誌嗎?應該在'apache \ logs \ error.log'。 – DaSourcerer
剛剛添加了最後的日誌記錄,嗯,「.htaccess:選項不允許在這裏」,它位於根文件夾的右側 –