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 found Umbraco will generate Templates' name to be pages within the website.
For example: I have a view 'Product.cshtml', and Umbraco will generate an Url http://www.xxx.com/product
How to stop that? Any solutions?
Thanks, Tony
Hi Tony,
I believe what you are seeing is that when you go to domain/templatename it takes you to the home page but tries to render it with the template.
This isn't exactly the same as it creating a url however, I'm not sure how you would stop this behaviour.
I have to admit it isn't something I've seen before and it would be very unlikely for someone to find that url in the first place.
Just out of interest, how did you identify this behaviour?
This is a side-effect of a feature in Umbraco called "alternative templates". Basically, if you have some page like site.com/some-page, you can force that page to render with a specific template by using the URL site.com/some-page/specific-template.
site.com/some-page
site.com/some-page/specific-template
There are a couple ways to disable this. One is to modify a setting to set disableAlternativeTemplates to true: https://our.umbraco.org/documentation/reference/config/umbracosettings/
disableAlternativeTemplates
Another way you might try (I'm unsure if this will work or might break something) is to remove this line from 404handlers.config:
404handlers.config
<notFound assembly="umbraco" type="SearchForTemplate"/>
Here is some further reading (haven't read it myself, but might be useful): http://www.codeshare.co.uk/blog/umbraco-alternate-template-feature-bug/
Hi Hicholas,
Both ways are working. Awesome.
Thanks Tony
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Umbraco 7 Template rending as web pages
Hi,
I found Umbraco will generate Templates' name to be pages within the website.
For example: I have a view 'Product.cshtml', and Umbraco will generate an Url http://www.xxx.com/product
How to stop that? Any solutions?
Thanks, Tony
Hi Tony,
I believe what you are seeing is that when you go to domain/templatename it takes you to the home page but tries to render it with the template.
This isn't exactly the same as it creating a url however, I'm not sure how you would stop this behaviour.
I have to admit it isn't something I've seen before and it would be very unlikely for someone to find that url in the first place.
Just out of interest, how did you identify this behaviour?
This is a side-effect of a feature in Umbraco called "alternative templates". Basically, if you have some page like
site.com/some-page
, you can force that page to render with a specific template by using the URLsite.com/some-page/specific-template
.There are a couple ways to disable this. One is to modify a setting to set
disableAlternativeTemplates
to true: https://our.umbraco.org/documentation/reference/config/umbracosettings/Another way you might try (I'm unsure if this will work or might break something) is to remove this line from
404handlers.config
:Here is some further reading (haven't read it myself, but might be useful): http://www.codeshare.co.uk/blog/umbraco-alternate-template-feature-bug/
Hi Hicholas,
Both ways are working. Awesome.
Thanks Tony
is working on a reply...