Skip to content

Instantly share code, notes, and snippets.

@nick-hoang
Created May 6, 2020 16:36
Show Gist options
  • Save nick-hoang/1527fa58ae040d38c2dad1e7a36d7bc4 to your computer and use it in GitHub Desktop.
Save nick-hoang/1527fa58ae040d38c2dad1e7a36d7bc4 to your computer and use it in GitHub Desktop.
Umbraco settings to remove vietnamese chars from Umbraco urls
<?xml version="1.0" encoding="utf-8"?>
<settings>
<!--
umbracoSettings.config configuration documentation can be found here:
https://our.umbraco.com/documentation/using-umbraco/config-files/umbracoSettings/
Many of the optional settings are not explicitly listed here
but can be found in the online documentation.
-->
<backOffice>
<tours enable="false"></tours>
</backOffice>
<content>
<errors>
<error404>1</error404>
<!--
The value for error pages can be:
* A content item's integer ID (example: 1234)
* A content item's GUID ID (example: 26C1D84F-C900-4D53-B167-E25CC489DAC8)
* An XPath statement (example: //errorPages[@nodeName='My cool error']
-->
<!--
<error404>
<errorPage culture="default">1</errorPage>
<errorPage culture="en-US">200</errorPage>
</error404>
-->
</errors>
<notifications>
<!-- the email that should be used as from mail when umbraco sends a notification -->
<!-- you can add a display name to the email like this: <email>Your display name here &lt;[email protected]&gt;</email> -->
<email>[email protected]</email>
</notifications>
<!-- Show property descriptions in editing view "icon|text|none" -->
<PropertyContextHelpOption>text</PropertyContextHelpOption>
<!-- The html injected into a (x)html page if Umbraco is running in preview mode -->
<PreviewBadge>
<![CDATA[<a id="umbracoPreviewBadge" style="z-index:99999; position: absolute; top: 0; right: 0; border: 0; width: 149px; height: 149px; background: url('{1}/preview/previewModeBadge.png') no-repeat;z-index: 9999999;" href="#" OnClick="javascript:window.top.location.href = '{0}/endPreview.aspx?redir={2}'"><span style="display:none;">In Preview Mode - click to end</span></a>]]></PreviewBadge>
<!-- How Umbraco should handle errors during macro execution. Can be one of the following values:
- inline - show an inline error within the macro but allow the page to continue rendering. Historial Umbraco behaviour.
- silent - Silently suppress the error and do not render the offending macro.
- throw - Throw an exception which can be caught by the global error handler defined in Application_OnError. If no such
error handler is defined then you'll see the Yellow Screen Of Death (YSOD) error page.
Note the error can also be handled by the umbraco.macro.Error event, where you can log/alarm with your own code and change the behaviour per event. -->
<MacroErrors>throw</MacroErrors>
<!-- These file types will not be allowed to be uploaded via the upload control for media and content -->
<disallowedUploadFiles>ashx,aspx,ascx,config,cshtml,vbhtml,asmx,air,axd,swf,xml,xhtml,html,htm,php,htaccess</disallowedUploadFiles>
<!-- Defines the default document type property used when adding properties in the back-office (if missing or empty, defaults to Textstring -->
<defaultDocumentTypeProperty>Textstring</defaultDocumentTypeProperty>
<!-- Enables value converters for all built in property editors so that they return strongly typed object, recommended for use with Models Builder -->
<EnablePropertyValueConverters>true</EnablePropertyValueConverters>
<!-- You can specify your own background image for the login screen here. The image will automatically get an overlay to match back office colors - this path is relative to the ~/umbraco path. The default location is: /umbraco/assets/img/installer.jpg -->
<loginBackgroundImage>assets/img/installer.jpg</loginBackgroundImage>
<!-- Enable / disable XML content cache -->
<XmlCacheEnabled>True</XmlCacheEnabled>
<!-- Update disk cache every time content has changed -->
<ContinouslyUpdateXmlDiskCache>True</ContinouslyUpdateXmlDiskCache>
<!-- Update in-memory cache if XML file is changed -->
<XmlContentCheckForDiskChanges>False</XmlContentCheckForDiskChanges>
<!-- Cache cycle of Media and Member data fetched from the umbraco.library methods -->
<!-- In seconds. 0 will disable cache -->
<UmbracoLibraryCacheDuration>1800</UmbracoLibraryCacheDuration>
</content>
<security>
<!-- set to true to auto update login interval (and there by disabling the lock screen -->
<keepUserLoggedIn>true</keepUserLoggedIn>
<!-- by default this is true and if not specified in config will be true. set to false to always show a separate username field in the back office user editor -->
<usernameIsEmail>false</usernameIsEmail>
<!-- change in 4.8: Disabled users are now showed dimmed and last in the tree. If you prefer not to display them set this to true -->
<hideDisabledUsersInBackoffice>false</hideDisabledUsersInBackoffice>
</security>
<requestHandler>
<!-- this will ensure that urls are unique when running with multiple root nodes -->
<useDomainPrefixes>false</useDomainPrefixes>
<!-- this will add a trailing slash (/) to urls when in directory url mode -->
<addTrailingSlash>true</addTrailingSlash>
<urlReplacing removeDoubleDashes="true">
<char org=" ">-</char>
<char org="&quot;"></char>
<char org="'"></char>
<char org="%"></char>
<char org="."></char>
<char org=";"></char>
<char org="/"></char>
<char org="\"></char>
<char org=":"></char>
<char org="#"></char>
<char org="+">-</char>
<char org="*">-</char>
<char org="&amp;"></char>
<char org="?"></char>
<char org="æ">ae</char>
<char org="ø">oe</char>
<char org="Ã¥">aa</char>
<char org="ä">ae</char>
<char org="ö">oe</char>
<char org="ü">ue</char>
<char org="ß">ss</char>
<char org="Ä">ae</char>
<char org="Ö">oe</char>
<char org="|">-</char>
<char org="æ"></char>
<char org="ø"></char>
<char org="å"></char>
<char org="ä"></char>
<char org="ö"></char>
<char org="ü"></char>
<char org="ß"></char>
<char org="Ä"></char>
<char org="Ö"></char>
<char org="ç"></char>
<char org="à">a</char>
<char org="á">a</char>
<char org="ã">a</char>
<char org="ả">a</char>
<char org="ạ">a</char>
<char org="ă">a</char>
<char org="ằ">a</char>
<char org="ắ">a</char>
<char org="ẳ">a</char>
<char org="ẵ">a</char>
<char org="ặ">a</char>
<char org="â">a</char>
<char org="ầ">a</char>
<char org="ấ">a</char>
<char org="ẩ">a</char>
<char org="ẫ">a</char>
<char org="ậ">a</char>
<char org="è">e</char>
<char org="é">e</char>
<char org="ẻ">e</char>
<char org="ẽ">e</char>
<char org="ẹ">e</char>
<char org="ê">e</char>
<char org="ề">e</char>
<char org="ế">e</char>
<char org="ể">e</char>
<char org="ễ">e</char>
<char org="ệ">e</char>
<char org="đ">d</char>
<char org="ù">u</char>
<char org="ú">u</char>
<char org="ủ">u</char>
<char org="ũ">u</char>
<char org="ụ">u</char>
<char org="ư">u</char>
<char org="ừ">u</char>
<char org="ứ">u</char>
<char org="ử">u</char>
<char org="ữ">u</char>
<char org="ự">u</char>
<char org="ò">o</char>
<char org="ó">o</char>
<char org="ỏ">o</char>
<char org="õ">o</char>
<char org="ọ">o</char>
<char org="ô">o</char>
<char org="ồ">o</char>
<char org="ố">o</char>
<char org="ổ">o</char>
<char org="ỗ">o</char>
<char org="ộ">o</char>
<char org="ơ">o</char>
<char org="ờ">o</char>
<char org="ớ">o</char>
<char org="ở">o</char>
<char org="ỡ">o</char>
<char org="ợ">o</char>
<char org="ì">i</char>
<char org="í">i</char>
<char org="ỉ">i</char>
<char org="ĩ">i</char>
<char org="ị">i</char>
</urlReplacing>
</requestHandler>
<templates>
<!-- To switch the default rendering engine to MVC, change this value from WebForms to Mvc -->
<defaultRenderingEngine>Mvc</defaultRenderingEngine>
</templates>
<scheduledTasks>
<!-- add tasks that should be called with an interval (seconds) -->
<!-- <task log="true" alias="test60" interval="60" url="http://localhost/umbraco/test.aspx"/>-->
</scheduledTasks>
<!-- distributed calls must be enabled when using Umbraco in a load balanced environment -->
<distributedCall enable="false">
<!-- the id of the user who's making the calls -->
<!-- needed for security, umbraco will automatically look up correct login and passwords -->
<user>0</user>
<!--
When distributed call is enabled, you need to add all of the servers part taking in load balancing
to the server list below.
-->
<servers>
<!--
Add ip number or hostname, make sure that it can be reached from all servers
you can also add optional attributes to force a protocol or port number.
Examples:
<server>127.0.0.1</server>
<server forceProtocol="http|https" forcePortnumber="80|443">127.0.0.1</server>
Generally when setting up load balancing you will designate a 'master' server,
Umbraco will always assume that the FIRST server listed in this list is the 'master'.
(NOTE: Not all load balancing scenarios have a 'master', depends on how you are setting it up)
In order for scheduled tasks (including scheduled publishing) to work properly when load balancing, each
server in the load balanced environment needs to know if it is the 'master'. In order for servers
to know this or not, they need to compare some values against the servers listed. These values
are either: serverName or appId. You should not enter both values but appId will always supersede serverName.
The serverName is the easiest and will work so long as you are not load balancing your site on the same server.
If you are doing this, then you will need to use appId which is equivalent to the value returned from
HttpRuntime.AppDomainAppId. It is recommended that you set either the serverName or appId for all servers
registered here if possible, not just the first one.
Examples:
<server serverName="MyServer">server1.mysite.com</server>
<server appId="/LM/W3SVC/69/ROOT">server1.mysite.com</server>
-->
</servers>
</distributedCall>
<!--
web.routing
@trySkipIisCustomErrors
Tries to skip IIS custom errors.
Starting with IIS 7.5, this must be set to true for Umbraco 404 pages to show. Else, IIS will take
over and render its built-in error page. See MS doc for HttpResponseBase.TrySkipIisCustomErrors.
The default value is false, for backward compatibility reasons, which means that IIS _will_ take
over, and _prevent_ Umbraco 404 pages to show.
@internalRedirectPreservesTemplate
By default as soon as we're not displaying the initial document, we reset the template set by the
finder or by the alt. template. Set this option to true to preserve the template set by the finder
or by the alt. template, in case of an internal redirect.
(false by default, and in fact should remain false unless you know what you're doing)
@disableAlternativeTemplates
By default you can add a altTemplate querystring or append a template name to the current URL which
will make Umbraco render the content on the current page with the template you requested, for example:
http://mysite.com/about-us/?altTemplate=Home and http://mysite.com/about-us/Home would render the
"About Us" page with a template with the alias Home. Setting this setting to true stops that behavior
@validateAlternativeTemplates
By default you can add a altTemplate querystring or append a template name to the current URL which
will make Umbraco render the content on the current page with the template you requested, for example:
http://mysite.com/about-us/?altTemplate=Home and http://mysite.com/about-us/Home would render the
"About Us" page with a template with the alias Home. Setting this setting to true will ensure that
only templates that have been permitted on the document type will be allowed
@disableFindContentByIdPath
By default you can call any content Id in the url and show the content with that id, for example:
http://mysite.com/1092 or http://mysite.com/1092.aspx would render the content with id 1092. Setting
this setting to true stops that behavior
@umbracoApplicationUrl
The url of the Umbraco application. By default, Umbraco will figure it out from the first request.
Configure it here if you need anything specific. Needs to be a complete url with scheme and umbraco
path, eg http://mysite.com/umbraco. NOT just "mysite.com" or "mysite.com/umbraco" or "http://mysite.com".
-->
<web.routing trySkipIisCustomErrors="false" internalRedirectPreservesTemplate="false" disableAlternativeTemplates="false"
validateAlternativeTemplates="false" disableFindContentByIdPath="false" umbracoApplicationUrl=""
disableRedirectUrlTracking="true">
</web.routing>
</settings>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment