Try adding a <set type="status">404</set>
for a rule maching /.*.html$
?
How to redirect url using tuckey urlrewrite
-
30-07-2022 - |
Question
I have a webpage named 'index.html', and I can use 'http://example.com/index.html' to access it.
What I intend to do is to access the 'index.html' using 'http://example.com/index.htm'; If using 'http://example.com/index.html', an 404 will return.
I'm using tuckey urlrewrite
, and here is my config xml:
<rule>
<from>^/(.*).htm$</from>
<to>/$1.html</to>
</rule>
<outbound-rule>
<from>^/(.*).html$</from>
<to >/$1.htm</to>
</outbound-rule>
After deploying it, I can use 'http://example.com/index.htm' to access my index.html, but when I'm using 'http://example.com/index.html', it still can access my index.html.
What should I do to make the server returning 404 when *.html is being requested? Thanks a lot!
No correct solution
OTHER TIPS
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow