我正在尝试从 URL 中删除 index.php,该 URL 与 EZPublish 站点上的 .htaccess 示例和 ForceVirtualHost=true 一起使用。问题是指向 index.php 的旧链接不再有效(从搜索引擎链接时会出现问题)。
我试图在.htaccess 中使用重写规则来解决这个问题,但我无法让它工作。我的一些尝试是:
尝试 1
RewriteCond %{REQUEST_URI} ^/index.php
RewriteRule ^index\.php(.*) http://www.mysite.com$1
RewriteCond %{REQUEST_URI} !^/index.php
RewriteRule .* index.php [L]
此尝试会导致无限循环。
尝试 2
RewriteCond %{REQUEST_URI} ^/(index\.php)?(.*)$
RewriteRule %2 index.php [L]
RewriteRule .* index.php [L]
也不起作用:-(。
注意。'RewriteRule .* index.php [L]' 是使 EZPublish 中的虚拟主机设置工作所必需的。
任何帮助将不胜感激。
薇薇安