我正在处理一项任务,我需要将所有流向特定文件夹的流量重定向回根目录:
Redirect /ridestream_start/ /index.php
#effectively, ridestream_start was our beta folder,
#and we're moving our functionality to the root folder
为"ridestream_start"中的每个文件和文件夹编写重定向代码并不是很有效,因为它们有很多......如何仅使用文件夹名称完成重定向编码?
你能用这样的东西吗:
RewriteEngine On
RewriteRule ^/ridestream_start/.* /index.php.com[L,R=301]
如果我正确理解您想要什么,我认为以下内容将起作用。
RewriteEngine on
RewriteBase /
RewriteRule ^ridestream_start/ /index.php