FKE*_*net 9 rewrite configuration apache-2.2
我的httpd.conf
文件中有这个:
<VirtualHost IP.AD.DR.ESS:80>
ServerName example.com
Redirect Permanent / https://example.net/
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
这成功地将以前的所有内容重定向http://example.com
到其新的相应位置https://example.net
。但是,我发现一个目录example.com/specialdir/
必须保留在旧服务器上,因为它需要访问的数据不在新服务器上。(完成涉及其他几十个站点的迁移需要几个月的时间。)
有没有合理的方法来解决这个问题,httpd.conf
或者我将不得不使用一堆.htaccess
文件?我怀疑我可以用<Location>
容器做一些事情,但我不知道要问正确的问题来查找信息。
hjp*_*r92 16
您可以修改该Redirect
指令以使用 aRedirectMatch
并使用排除模式/specialdir
:
RedirectMatch Permanent "^(/(?!specialdir/).*)" https://example.net/$1
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
10997 次 |
最近记录: |