Link to home
Start Free TrialLog in
Avatar of Sangeet Agarwal
Sangeet Agarwal

asked on

Redirect from push location strategy to hash location strategy

I have a legacy AngularJS site that I'm maintaining.

All that I need to do is redirect http://publicstaging.ncqa.org/Ncqa.NewReportCard/practice/Practice_001G000001nU3c5IAC  to http://publicstaging.ncqa.org/Ncqa.NewReportCard/#/practice/Practice_001G000001nU3c5IAC.

Notice the site is using the hash location strategy.

I would like to use the rewrite module in IIS.

I'll have to test the solution on our staging site that uses IIS version 7.5.

On our production servers I have IIS version 10.0.14393.0

Can someone let me know what the rewrite rules should look like
Avatar of Sangeet Agarwal
Sangeet Agarwal

ASKER

https://www.mattburkedev.com/iis-rewrite-rule-for-single-page-apps/

I probably need to do the reverse of what the above link says...
I think I found the solution...

       <rewrite>
                  <rules>
                        <rule name="teladoc" stopProcessing="true">
                         <match url="(.*)" />
                         <conditions logicalGrouping="MatchAny" trackAllCaptures="false">
                              <add input="{HTTP_HOST}{REQUEST_URI}" pattern="publicstaging.ncqa.org/Ncqa.NewReportCard/practice/Practice_001G000001nU3c5IAC" />
                         </conditions>
                         <action type="Redirect" url="http://publicstaging.ncqa.org/Ncqa.NewReportCard/#/practice/Practice_001G000001nU3c5IAC" redirectType="Permanent"/>
                         </rule>
                   </rules>
            </rewrite>
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.