Ayo Adesina
Ayo Adesina

Reputation: 2395

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?

Upvotes: 0

Views: 347

Answers (1)

BeaverProj
BeaverProj

Reputation: 2215

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/

Upvotes: 0

Related Questions