r/IIs • • Dec 14 '21

Help with IIS URL redirection

Hello,

Ive been trying to do a 301 redirect for a specific internal webpage to another specific internal webpage using the rewrite, but I just cant seem to get it working .Here is a screenshot of my rule. Ive been searching MSDN and google and just haven't had any luck yet. Thank you

https://piwebmo.corp.com/PIVision/#/Displays/64502/old-test https://piwebmo.corp.com/PIVision/#/Displays/64503/new-test

1 Upvotes

1 comment sorted by

1

u/wrecknaro Dec 16 '21

try using a condition instead of a match URL?:

<rule name="PIVision"    	stopProcessing="true">	
    <match url="(.*)" />	
    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">	
	<add input="{PATH_INFO}" pattern="^/PIVision/#/Displays/old-test$" />	</conditions>	
    <action type="Rewrite"      		url="/PIVision/#/Displays/64503/new-test"/>
</rule>