我有(例如)站点help.test.pl
我想将子网站help.test.pl/site1的网址改为另一个网址:help.test.pl/site1/info/sport
如果我在阿帕奇做了
Redirect 301 /site1 https://help.test.pl/site1/info/sport如果我在浏览器中运行站点help.test.pl/site1,URL的"info/sport/“就会被循环。
URL如下所示:
https://help.test.pl/site1/info/sport/info/sport/info/sport/info/sport/info/sport/info/sport/info/sport/info/sport/info/sport/info/sport/info/sport/info/sport/info/sport/info/sport/info/sport/info/sport我做错了什么?
发布于 2017-10-26 08:34:03
您可以在下面使用一种方法:
使用RewriteRule**.** 1)
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} /site1$
RewriteRule ^/?(.*)$ https://help.test.pl/site1/info/sport [R=301,L]使用RedirectMatch 2)
RedirectMatch 301 /site1$ https://help.test.pl/site1/info/sport编辑:添加另一个页面。
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} /site1$ [OR]
RewriteCond %{REQUEST_URI} /site2$
RewriteRule ^/?(.*)$ https://help.test.pl/$1/info/sport [R=301,L]https://stackoverflow.com/questions/46948517
复制相似问题