How to change URL names in Umbraco

試著忘記壹切 提交于 2019-12-02 19:44:36
c0demaster

Editing @run yards Solution by digbyswift help in comment

Correct Solution:

  1. Create Property on in Document Types which applies to all pages you want to change the URL
  2. Call the name anything you want e.g Page URL and Possibly give it a new tab.
  3. Call the alias umbracoUrlName
  4. Type as text sting
  5. Should not be Mandatory (As when you start replacing .Url with .umbracoUrlAlias within the views it will need to be present)
  6. Tab as Generic
  7. Click Save on top right on the page

Added screenshot for starter kit on Umbraco v7.2.5

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.

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.

Solution:

  • Create property on in Document Types which applies to all pages you want to change the URL
  • Call the name anything you want e.g Page URL and Possibly give it a new tab.
  • Call the alias umbracoUrlAlias
  • Type as text sting
  • Make it required (As when you start replacing .Url with .umbracoUrlAlias within the views it will need to be present)
  • Go into all your pages and rename them using the property you just created
  • Now with your code, say with the navigation where you have used .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.

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" />
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!