我正在使用ExpressionEngine並希望從我的URL中刪除index.php
。我有這個.htaccess文件保存在根文件夾中。它在localhost上完美工作,但是當我將它上傳到服務器時,它不起作用。地址欄中顯示正確的網址,但頁面仍保留在主頁上。有小費嗎?.htaccess不在現場工作,但在本地主機上工作?
<IfModule mod_rewrite.c>
# Enable Rewrite Engine
# ------------------------------
RewriteEngine On
RewriteBase/
# Redirect index.php Requests
# ------------------------------
RewriteCond %{THE_REQUEST} ^[^/]*/index\.php [NC]
RewriteCond %{THE_REQUEST} ^GET
RewriteRule ^index\.php(.+) $1 [R=301,L]
# Standard ExpressionEngine Rewrite
# ------------------------------
RewriteCond $1 !\.(css|js|gif|jpe?g|png) [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>