本人菜鳥,用寶塔面板配置的LAMP,上傳thinkPHP 3.2.3(代碼在wamp中測試可用)。訪問http://www.xxx.me/Home/Index/... 直接報錯File not found,console顯示:Failed to load resource: the server responded with a status of 404 (Not Found)
此時的.htaccess為默認(rèn)的
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>
.htaccess修改為以下之后就能訪問http://www.xxx.me/Home/Index/... 了
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?s=/$1 [QSA,PT,L]
</IfModule>
但是引用自public的圖片和js均無法顯示,例如console顯示http://kusima.me/public/js/jq... Failed to load resource: the server responded with a status of 404 (Not Found)
直接打開http://www.xxx.me/public/js/j...會報錯無法加載模塊:Public
補(bǔ)充說明:文件目錄是TP默認(rèn)的如下
入口文件是默認(rèn)的定義// 定義應(yīng)用目錄define('APP_PATH','./Application/');
[ Apache ]也有相應(yīng)配置httpd.conf配置文件中加載了mod_rewrite.so模塊AllowOverride None 將None改為 All
配置文件中已設(shè)置url模式'URL_MODEL' => 1,
這一切在wamp中測試均無出錯。請教大家,不知道哪里出錯了??
- 4 回答
- 0 關(guān)注
- 1997 瀏覽
添加回答
舉報
0/150
提交
取消