index.php 301重定向不适用于Joomla站点
问题描述:
I tried below code in .htaccess with my Joomla site but it is not working at all:
Redirect 301 /index.php /
I also tried:
Redirect 301 www.domain.com/index.php www.domain.com/
Basically I don't want to have duplicate pages and currently I can view the home page with index.php and without.
I have no idea why Joomla does this but it's not working at all. I've also done 301 redirect under Artio SEO component but it doesn't work either.
我尝试使用我的Joomla网站在.htaccess下面的代码,但它根本不起作用: p> \ n
重定向301 /index.php /
code> pre>
我也尝试过: p>
重定向301 www.domain.com/index.php www.domain.com/
nn基本上我不希望有重复的页面,目前我可以查看 带有index.php和没有的主页。 p>
我不知道为什么Joomla这样做但它根本不起作用。 我也在Artio SEO组件下完成了301重定向,但它也不起作用。 p>
div>
答
Try this:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{THE_REQUEST} ^.*/index.php
RewriteRule ^(.*)index.php$ "http\:\/\/www\.yourdomain\.com\/$1" [R=301,L]
</IfModule>