0
在新服务器上创建开发站点后,htaccess文件错误地重定向链接。例如,如果点击来自example.com的链接example.com/test,它将尝试重定向到example.com/example.com/test。我怎样才能纠正下面的htaccess文件:.htaccess文件重定向不正确
<IfModule mod_rewrite.c>
# Turn on the Rewrite Engine
RewriteEngine On
RewriteBase/
# If the file or directory exists, show it
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+) - [PT,L]
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
# Blank queries get sent to the index
RewriteRule ^$ /index.php [L]
# All other queries get sent to the index as index.php/whatever
RewriteRule ^(.*)$ /index.php?$1 [L]
</IfModule>
<ifModule mod_headers.c>
Header set Connection keep-alive
</ifModule>
,当你键入'http://www.example.com/会发生什么测试'在浏览器中? – anubhava 2014-10-30 16:53:17
可能你在HTML – Deadooshka 2014-10-30 16:57:15
@anubhava中有'href =“example.com/test”',它工作的很好。 – user2694306 2014-10-30 17:05:25