Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
I have just installed Umbraco 7.12.1 from scratch. I can see the old way with URLRewriting.config file has been deprecated. I have tried with IIS rewrite instead but not succeeded.
Example I have a URL https://mysite.com/contact I would like when user types that URL. It will become https://mysite.com/contact.html
I have tried this
<rewrite> <rules> <rule name="Rewrite rule1 for RewriteHtml"> <match url=".*" /> <conditions> <add input="{RewriteHtml:{REQUEST_URI}}" pattern="(.+)" /> </conditions> <action type="Rewrite" url="{C:1}" appendQueryString="false" /> </rule> </rules> <rewriteMaps> <rewriteMap name="RewriteHtml"> <add key="/contact.html" value="/contact" /> </rewriteMap> </rewriteMaps> </rewrite>
How can I achieve this in new Umbraco? Thanks very much
I think you may have your key and value the wrong way around:
<add key="/contact.html" value="/contact" />
Should be:
<add key="/contact" value="/contact.html" />
Hope that works for you!
Ben
Hi Ben,
That worked fine but both links can be accessible as well. How can we avoid this? So if user access to "/contact" then they should get a 404.
When you say it's working, what's happening?
With the above rule /contact should take you to /contact.html every time. Unless you mean /contact/ (notice the trailing slash)?
/contact
/contact.html
/contact/
Thanks,
Thanks for you reply Ben
it is working with these url: .../contact .../contact.html .../contact/ (no matter this works or not)
I would like ONLY ".../contact.html" work. the rest should return 404.
Can we do this in Umbraco? Thanks
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
IIS Rewrite in Umbraco 7.12.1
Hi,
I have just installed Umbraco 7.12.1 from scratch. I can see the old way with URLRewriting.config file has been deprecated. I have tried with IIS rewrite instead but not succeeded.
Example I have a URL https://mysite.com/contact I would like when user types that URL. It will become https://mysite.com/contact.html
I have tried this
How can I achieve this in new Umbraco? Thanks very much
Hi,
I think you may have your key and value the wrong way around:
Should be:
Hope that works for you!
Ben
Hi Ben,
That worked fine but both links can be accessible as well. How can we avoid this? So if user access to "/contact" then they should get a 404.
Hi,
When you say it's working, what's happening?
With the above rule
/contact
should take you to/contact.html
every time. Unless you mean/contact/
(notice the trailing slash)?Thanks,
Ben
Thanks for you reply Ben
it is working with these url: .../contact .../contact.html .../contact/ (no matter this works or not)
I would like ONLY ".../contact.html" work. the rest should return 404.
Can we do this in Umbraco? Thanks
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.