Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我使用以下重定向页面。
RedirectMatch 301 /mytake/huts(.*) /mytake/surveys/$1
并且有效,实际上更改了我不想要的地址栏中的 URL。
我尝试了以下这根本不起作用。
RewriteRule ^mytake/huts$ mytake/surveys/ [L,R=301]
我的问题是为什么第二行不起作用???
我的测试网址是:http ://www.mydomain.com/mytake/huts (不要点击,把它当作测试网址:))
如果我理解正确:
RewriteEngine on RewriteRule ^mytake/huts/(.*)$ mytake/surveys/$1 [L,QSA]
地址将保持不变。
PS 运行命令a2enmod rewrite并检查 conf 文件中的 AllowOverride 指令。
a2enmod rewrite