我应该对页面列表进行内部重定向(301)。 首先,当用户打开/或/index.php时,他应该被重定向到em.php,放在根文件夹中。当用户打开/contents/about_us/index.php时,他应该被重定向到about_us / enterprise.php 声音简单,但我还是无法解决 当我使用这个
Redirect 301 / http://foo2.bar.com/service
Redirect 301 /index.php http://foo2.bar.com/service
它有效。 但是当我尝试这个时
Redirect 301 / http://www.site.com/em.php
我正在http://www.site.com/em.phpem.phpem.phpem.phpem.phpem.phpem.phpem.phpem.php ...
我的代码出了什么问题?
答案 0 :(得分:1)
你的Redirect
正在进入循环。
请在.htaccess
或DocumentRoot
部分的virtualhost
文件中执行此操作。
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/$ [NC]
RewriteRule ^ /em.php [L,R=301]