2

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?

hjpotter92
  • 78,589
  • 36
  • 144
  • 183

1 Answers1

1

Try :

RedirectMatch 302 ^/((?!home/index\.php/quality/.*).+)$  http://www.mynewdomain.com/$1
Amit Verma
  • 40,709
  • 21
  • 93
  • 115
  • 1
    Thanks for you answer. This would be a correct solution, but I totally forgot that in order to properly load data from /quality, It's necessary to keep access the basic Joomla directories (images/templates/admin panel). I fixed it just adding exceptions to the redirection. – sysfortress Nov 23 '15 at 17:10