網頁使用了一個YYUC的框架,該框架偽靜態使用的是.htaccess文件實現,但現在主機是nginx環境,無法使用.htaccess文件,想問大神如何可以在nginx中使用。 該文件代碼如下: <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_FILENAME... 網頁使用了一個YYUC的框架,該框架偽靜態使用的是.htaccess文件實現,但現在主機是nginx環境,無法使用.htaccess文件,想問大神如何可以在nginx中使用。該文件代碼如下:<IfModule mod_rewrite.c>RewriteEngine onRewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule . index.php [L]</IfModule>
1 回答

隔江千里
TA貢獻1906條經驗 獲得超10個贊
nignx不需要用htaccess,只需要在nginx配置文件加上如下內容就可以,請根據自己情況自行修改
123456 location / { if (!-e $request_filename) { rewrite ^/(.*)$ /index.php/$1 last; break; } }
- 1 回答
- 0 關注
- 2213 瀏覽
添加回答
舉報
0/150
提交
取消