0

我创建了一个 htaccess 表单,它只包含:

<IfModule mod_rewrite.c>
RewriteEngine On
# Removes index.php from ExpressionEngine URLs
RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

->在最新的用户指南中显示为删除 index.php 的新支持方式。

一切都很好,我的联系表单工作正常 - 除了表单提交后,显示消息然后重定向它没有重定向回我指定的主页(当前是 testsite7)但它实际上重定向到“testsite7/_mp3 “我不知道为什么它会显示这个?那是我服务器上的一个文件夹,里面有音乐文件。

我的站点位于插件域上,EE 安装位于根目录之上。

有任何想法吗 !

4

1 回答 1

0

有趣,不知道为什么它会重定向到那个特定的文件夹,我不明白为什么那个代码会导致它。可能值得尝试不同的 .htaccess 方法来缩小问题的范围。这是我们在所有大型网站上使用的一种,并且一直运行良好。也许试一试:

# turn on mod_rewrite
RewriteEngine On
RewriteBase /

# make sure index.php is always removed from url
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+index\.php(/[^\s\?]+)? [NC]
RewriteRule ^ %1 [L,R=301]

# make sure we don't have a trailing slash unless it's a directory
# RewriteCond %{REQUEST_FILENAME} !-d
# RewriteRule ^(.+)/$ /$1 [L,R=301]

# make sure requests are routed through index.php but not in url this helps certain addons.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^ index.php%{REQUEST_URI} [L,NC]
于 2013-02-02T03:51:04.553 回答