How to configure Apache mod_rewrite to redirect all but one subfolder
I just created a new website and am ready to move from the current web server to the new web server.
The current web server will be renamed to www2 The new web server will be known as www
I want to redirect all traffic from www2 to www except one directory. My directory structure looks like this:
/var /www /html index.html page2.html /orange index.html ... /archive index.html important-page1.html important-page2.html /turquoise index.html ...
I would like to redirect everything to the equivalent www page
e.g. www2.mydomain.com/orange/index.html -> www.mydomain.com/orange/index.html www2.mydomain.com/turquoise/index.html -> www.mydomain.com/turquoise/index.html
EXCEPT for the / archive folder. I would like users to request:
www2.mydomain.com/archive/important-page1.html to view the page on www2 and not .
Should I use mod_rewrite or mod_redirect? And can I set this in httpd.conf?
source to share