0

I am using DNN as my website platform. Here is the situation:

Our software has links to online documents stored on our website hosting space. It consists of multi-language. However, there are several languages are not available yet. Therefore when the user clicks some of our help items in the software, it will display "404 error" because the page does not exist.

Since there are over hundreds of pages not exist. It will spend too much time to match one by one (and they do not even exist on the site). Therefore we want to redirect them all to the default English one.

The limitation is we can not modify the software because it can be used offline. So we have to do something on the website hosting.

The solution I thought is redirect all non-existing files under a specific folder to a page. The folder will be empty.

Only non-existing pages under that specific folder will redirect to a page. Other non-existing pages on the website will still go to 404.

I have tried to modify the web.config file but it is not working

<rewrite>
      <rules>
        <clear />
        <rule name="Online Document 404 Redirection" stopProcessing="true">
          <match url="/Help/sub/xe/nonexist/(.*)" />
          <action type="Redirect" url="/Help/sub/xe/en/index.htm" />
        </rule>
      </rules>
</rewrite>

Still goes to 404 error page.

2 Answers 2

0

You can set 404 redirect under Site Setting, don't need to modify Web.Config

enter image description here

1
  • Thanks for the answer however I just want the redirection in under one of the folder. Not the entire site. So in the case above, I want to redirect all non-exist files under /Help/sub/xe/nonexist/ to /Help/sub/xe/en/index.htm. Other non-existing files still goes to 404 page.
    – Xeno
    May 17, 2019 at 1:49
0

I don't think the IIS url rewriter (not installed by default) could help here as it will redirect all urls in the folder.

The best option would be to redirect users from the 404 page under certain conditions. You could add some logic for this to the theme/skin on the 404 page. We also have (free) module the does the same if you want.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.