简体   繁体   中英

Umbraco 4.7 - Domain Level URL Rewriting

I'm using Umbraco 4.7 and I am trying to use the UrlRewriting.config file to set up a domain level URL redirect.

So for example, if a user hits the website at the following URL

www.OLD-Domain.com/join.aspx

I want rewrite the URL permanently to:

www.NEW-Domain.com/join.aspx

I'm hoping that the search engines will be able to see this too when they next visit the site to re-index it.

Examples/Ideas please?

If you don't want to use IIS redirects or sites to do this, then you can use an Umbraco config file to do the job for you:

  1. Go to your "Config" directory in your main Umbraco website directory.

  2. Edit the "URLRewriting.config" file in your favorite text editor.

  3. Add the following code between the (paste here) tags:

<add name="SEOfix" virtualUrl="^http://domain.com/(.*)" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="http://newdomain.com/$1" redirect="Domain" redirectMode="Permanent" ignoreCase="true" />

<add name="SEOfixSSL" virtualUrl="^https://domain.com/(.*)" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="https://newdomain.com/$1" redirect="Domain" redirectMode="Permanent" ignoreCase="true" />

  1. Save the file and test.

See more at: http://www.proworks.com/blog/2011/03/31/permanent-301-redirect-domaincom-to-wwwdomaincom-in-umbraco/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM