November Happy Hour will be moved to Thursday December 5th.

How to redirect website home page in BVN404handler

Vote:
 

I would like to redirect the website launch(home) page to add '/en/' at the end of the launch URL for multi language. 

I tried in BVN404handler by adding source URL as just '/' and target url as just '/en/' but this is causing issues for other redirects that already exists. it's causing recursive redirects by keep adding /en/en/en/.. for every other redirects that exists. 

Could some one please sugegst the best way to implement this ?

Regards,

Suresh

#203533
Apr 26, 2019 11:41
Vote:
 

Hi Suresh,

Do you need to use the 404 handler for this? I suspect you'd struggle to make this work, not least because that only redirects on URLs which return a 404 and '/' should always return a page (assuming you have a site set up on that host). I'd probably set up the redirect in the web.config using URL rewrite rules like this:

<system.webServer>
  <rewrite>
    <rules>
      <rule name="Redirect Root">
        <match url="^$" />
        <action type="Redirect" url="/en/" />
      </rule>
    </rules>
  </rewrite>
</system.webServer>
#203549
Apr 26, 2019 14:43
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.