简体   繁体   中英

Redirect URL to new URL

How do I redirect all traffic from test/(.*) to http://newdomain.com/test/ $1? I tried this, but that didn't work: RewriteRule ^test/(.*) http://domain.com/test/ $1 [R=301,L]

在重写规则之前添加RewriteEngine On行。

我想,您需要在规则的开头添加斜杠:

RewriteRule ^/test/(.*) http://domain.com/test/$1 [R=301,L]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM