简体   繁体   中英

Redirect everything but 1 URL and it's sub URL's

I'm trying to redirect everything on a website but 1 Joomla URL (and URLS containing this keyword). Example:

Should redirect everything from www.mydomain.com to www.mynewdomain.com but this:

www.mydomain.com/home/index.php/quality/*

I tried something like this:

RedirectMatch 302 /home/index.php/(?!quality)  http://www.mynewdomain.com

But It won't redirect / or /home. Also, I tried the following but won't work:

RedirectMatch 302 (?!quality)  http://www.mynewdomain.com

Is there a way to archive this?

尝试 :

RedirectMatch 302 ^/((?!home/index\.php/quality/.*).+)$  http://www.mynewdomain.com/$1

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