Reputation: 2034
This is my first time round using Umbraco and I have created Document Types / Pages using the wrong naming format and now this has transpired into my page URL's, for instance /about-page/
. How would I go about changing them to /about
as I have searched the back-end admin panel and there dose't seem to be an option to change their link to document
values.
Would anyone be able to provide a simple code based example using umbracoUrlAlias or umbracoUrlName how I could change this preferably in Razor.
Thanks
Upvotes: 9
Views: 16787
Reputation: 740
Editing @run yards Solution by digbyswift help in comment
Correct Solution:
.Url
with .umbracoUrlAlias
within the views it will need to be present)Added screenshot for starter kit on Umbraco v7.2.5
Upvotes: 23
Reputation: 25339
You can also create a property called umbracoUrlName
using a TextString
property editor. If this has a value then it will generate the URL fragment for the page using this value, rather than the page name. This changes the URL for the page, rather than creating an alias, like umbracoUrlAlias
.
Upvotes: 2
Reputation: 2016
You can apply on URL names in web.config:
In section find:
<add key="umbracoUseDirectoryUrls" value="false" />
this will set url names for new created items to name.aspx
If you set this to 'true' then new items will be named like /name/
Additionaly you might want to avoid of Handling some urls by Umbraco pipline, just use this setting - add URLs which must be bypassed:
<add key="umbracoReservedUrls" value="~/config/splashes/booting.aspx,~/install/default.aspx,~/config/splashes/noNodes.aspx,~/VSEnterpriseHelper.axd" />
Upvotes: 0
Reputation: 10400
Unless I'm very much misunderstanding your issue, you should just be able to change the name of your page and republish. This doesn't need an additional field, just change the value in the "Properties" tab and republish the page. This will automatically change the URL of the page.
Upvotes: 4
Reputation: 2034
Solution:
.Url
with .umbracoUrlAlias
within the views it will need to be present).Url
change it to .umbracoUrlAlias
and the new URL's will be used.Note if you don't use .umbracoUrlAlias
the links will still be active i.e. they work but they won't be displayed in the address bar as .Url
spits out the original ones associated with the page.
Upvotes: 0