Cha*_*ell 4 mediatemple expressionengine
我有一个带有标准ExpressionEngine htaccess代码的MT站点,用于删除index.php并且主页可以工作,如果我将index.php放在URL中,所有其他页面都可以工作.没有它,我得到"没有指定输出文件".它适用于我的本地和非MT服务器,所以我知道它是一个环境的东西.需要更改htaccess中的哪些内容才能使其在MT上运行?
<IfModule mod_rewrite.c>
# Enable Rewrite Engine
# ------------------------------
RewriteEngine On
RewriteBase /
# Use Dynamic robots.txt file
# ------------------------------
RewriteRule robots\.txt /robots.php [L]
# Redirect index.php Requests
# ------------------------------
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
RewriteCond %{THE_REQUEST} !/admin/.*
RewriteRule (.*?)index\.php/*(.*) /$1$2 [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>
Run Code Online (Sandbox Code Playgroud)
感谢@danielcgold通过twitter获得答案:
尝试使用此行RewriteRule ^(.*)$ /index.php?/$1 [L]并注意?在index.php之后
我昨晚在(mt)的所有ExpressionEngine网站上发布了我的标准重写规则.
## BEGIN Expression Engine Rewrite
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
RewriteRule ^(.*)$ /index.php?/$1 [L]
## END Expression Engine Rewrite
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1630 次 |
| 最近记录: |