Skip to content

Commit af610d8

Browse files
committed
404 pages redirect
1 parent 70c11b6 commit af610d8

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

_layouts/default-layout.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@
4141
</div>
4242
<div class="main row showRightSideMenu" id="articleContent" data-needh3="{{page.needGenerateH3Content}}">
4343
<div class="content markdown-body headCounter {{noTitleIndex}} col-xs-12 col-md-12 col-lg-9 col-xl-10 showRightSideMenu">
44-
{{ content }}
44+
<div class="pageNoteFoundNote" style="display: none; background-color: #fffbe6; border: 1px solid #ffe58f; padding: 8px 20px; margin-top: 5px;"></div>
4545

46+
{{ content }}
4647
</div>
4748
<div class="rightSideMenu col-xs-12 col-md-12 col-lg-3 col-xl-2 hide-md hide-sm hide-xs showRightSideMenu">
4849
<div id="feedbackFooter" style="color: #306877;">
@@ -87,7 +88,11 @@
8788
</script>
8889

8990
<script type="text/javascript">
90-
91+
var redirectType = getUrlVars(document.URL)["redirect"]
92+
if (redirectType != undefined && redirectType == '404') {
93+
$(".pageNoteFoundNote").html(`Page not found. Please browse the sidebar to see if you can find the information you're looking for, or contact <a href="mailto:support@dynamsoft.com">support@dynamsoft.com</a> for assistance.`)
94+
$(".pageNoteFoundNote").show()
95+
}
9196
$('#txtSearch').keydown(function(e) {
9297
if (e.keyCode == 13) {
9398
window.location.href = '/web-twain/docs/search.html?q=' + $('#txtSearch').val()

web.config

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,36 +24,40 @@
2424
</conditions>
2525
</rule>
2626

27-
<rule name="Redirect rule30 for redirect dnt/kb pages" enabled="true" patternSyntax="ECMAScript">
27+
<rule name="Redirect rule30 for redirect dnt/kb pages" enabled="true" patternSyntax="ECMAScript" stopProcessing="true">
2828
<match url="indepth/troubleshooting/common-errors/activating-the-WebTwain-instance.html" ignoreCase="true" negate="false" />
2929
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
3030
<action type="Redirect" url="https://www.dynamsoft.com/web-twain/docs/indepth/faqs/troubleshooting/activating-the-WebTwain-instance-prompt-doesnt-disappear.html?ver=latest" appendQueryString="false" logRewrittenUrl="false" />
3131
</rule>
3232

33-
<rule name="Redirect /indepth/faqs/distribution/How-to-set-the-MIME-type.html" enabled="true" patternSyntax="ECMAScript">
33+
<rule name="Redirect /indepth/faqs/distribution/How-to-set-the-MIME-type.html" enabled="true" patternSyntax="ECMAScript" stopProcessing="true">
3434
<match url="indepth/faqs/distribution/How-to-set-the-MIME-type.html" ignoreCase="true" negate="false" />
3535
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
3636
<action type="Redirect" url="https://www.dynamsoft.com/web-twain/docs/indepth/deployment/server.html#make-sure-the-static-files-can-be-served-correctly" appendQueryString="false" logRewrittenUrl="false" />
3737
</rule>
3838

39-
<rule name="Redirect rule59 - https://www.dynamsoft.com/web-twain/docs/about/faqs.html" enabled="true" patternSyntax="ECMAScript">
39+
<rule name="Redirect rule59 - https://www.dynamsoft.com/web-twain/docs/about/faqs.html" enabled="true" patternSyntax="ECMAScript" stopProcessing="true">
4040
<match url="about/faqs.html" ignoreCase="true" negate="false" />
4141
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
4242
<action type="Redirect" url="https://www.dynamsoft.com/web-twain/docs/indepth/faqs/?ver=latest" appendQueryString="false" logRewrittenUrl="false" />
4343
</rule>
4444

45-
<rule name="Redirect https://www.dynamsoft.com/web-twain/docs/faq/how-to-enable-remote-scan.html" enabled="true" patternSyntax="ECMAScript">
45+
<rule name="Redirect https://www.dynamsoft.com/web-twain/docs/faq/how-to-enable-remote-scan.html" enabled="true" patternSyntax="ECMAScript" stopProcessing="true">
4646
<match url="faq/how-to-enable-remote-scan.html" ignoreCase="true" negate="false" />
4747
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
4848
<action type="Redirect" url="https://www.dynamsoft.com/remote-scan/docs/introduction/" appendQueryString="false" logRewrittenUrl="false" />
4949
</rule>
5050

51-
<rule name="Redirect https://www.dynamsoft.com/web-twain/docs/faq/how-come-would-some-customers-need-local.dynamsoft.com.html" enabled="true" patternSyntax="ECMAScript">
51+
<rule name="Redirect https://www.dynamsoft.com/web-twain/docs/faq/how-come-would-some-customers-need-local.dynamsoft.com.html" enabled="true" patternSyntax="ECMAScript" stopProcessing="true">
5252
<match url="faq/how-come-would-some-customers-need-local.dynamsoft.com.html" ignoreCase="true" negate="false" />
5353
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
5454
<action type="Redirect" url="https://www.dynamsoft.com/web-twain/docs/faq/how-come-would-you-need-local.dynamsoft.com.html" appendQueryString="false" logRewrittenUrl="false" />
5555
</rule>
5656
</rules>
5757
</rewrite>
58+
<httpErrors errorMode="DetailedLocalOnly" defaultResponseMode="File" >
59+
<remove statusCode="404" />
60+
<error statusCode="404" path="https://www.dynamsoft.com/web-twain/docs/about/?redirect=404" />
61+
</httpErrors>
5862
</system.webServer>
5963
</configuration>

0 commit comments

Comments
 (0)