Member_2_6109592
asked on
IIS rewrite rules for subsites as subfolders but not all
IIS (Win2012R2) site instance that needs to be partially redirected. This one's a challenge...
oldsite.com (root) > newsite.com
oldsite.com/PathA > newsite.com
oldsite.com/specialPath1 is not redirected at all (there are 4 of these)
oldsite.com/anythingElse > newsite.com/anythingElse
Started off by using match
This works as expected from what I can tell
Then added next rule with match
Then finally added rule with match
The overall output is working with ONE major exception... this is Hosting Drupal and specialPath1 (2, 3 and 4) are sub-sites. Those subsides don't work because the root directory (this themes, etc) isn't available anymore. Its interpreting the path as literal, so when entering URL oldsite.com/specialPath1, it's giving me missing directory error.
Then I disabled above three rules and created one rule:
Sent request URL "does not match the pattern ^(specialPath1|specialPath 2|specialP ath3|speci alPath4)), no added conditions, and redirect URL is http://newsite/com/{R:0} (append query string is selected)
The specialPath1 site works, but anytime redirected is missing the substring, so oldsite.com/anything is being passed to root of newsite.com
Odd situation, but there something I'm missing or simpler approach?
oldsite.com (root) > newsite.com
oldsite.com/PathA > newsite.com
oldsite.com/specialPath1 is not redirected at all (there are 4 of these)
oldsite.com/anythingElse > newsite.com/anythingElse
Started off by using match
^(PathA|PathB|PathC)$
which redirects to URL: http://newsite.com (append query string is not selected)This works as expected from what I can tell
Then added next rule with match
^(specialPath1|specialPath2|specialPath3|specialPath4)/.*$
with action type None & Stop processing of subsequent rules - thinking it would just stay on the siteThen finally added rule with match
(.*)
and conditions
^(www.)?oldsite\.com(.*)
set to redirect to URL: http://newsite.com/{R:0} (append query string is selected) The overall output is working with ONE major exception... this is Hosting Drupal and specialPath1 (2, 3 and 4) are sub-sites. Those subsides don't work because the root directory (this themes, etc) isn't available anymore. Its interpreting the path as literal, so when entering URL oldsite.com/specialPath1, it's giving me missing directory error.
Then I disabled above three rules and created one rule:
Sent request URL "does not match the pattern ^(specialPath1|specialPath
The specialPath1 site works, but anytime redirected is missing the substring, so oldsite.com/anything is being passed to root of newsite.com
Odd situation, but there something I'm missing or simpler approach?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.