.htaccess 再来一个重定向301
我应该为页面列表执行内部重定向(301)。 首先,当用户打开/or/index.php时,他应该被重定向到em.php,放在根文件夹中。当用户打开/contents/about_us/index.php时,他应该被重定向到about_us/enterprise.php 听起来很简单,但我还是无法解决 当我用这个的时候.htaccess 再来一个重定向301,.htaccess,redirect,.htaccess,Redirect,我应该为页面列表执行内部重定向(301)。 首先,当用户打开/or/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/ser
Redirect 301 / http://foo2.bar.com/service
Redirect 301 /index.php http://foo2.bar.com/service
它起作用了。
但是当我尝试这个的时候
Redirect 301 / http://www.site.com/em.php
我要
我的代码出了什么问题?您的
重定向陷入循环
改为在DocumentRoot
中的.htaccess
文件中或在virtualhost
部分中执行此操作
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/$ [NC]
RewriteRule ^ /em.php [L,R=301]