Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I'm looking for a way to set up a primary domain on a site.
I have 4 URLs to the same site, but need one of them to be the active one, and the others to point to it:
It should be so that when you e.g. type www.domain.us in your browser, you go to domain.com through a 301 redirect.
Can anyone help me with this? It doesn't seem to be a built in feature in Umbraco.
You can do this by using the built in URL re-writing.
In the UrlRewriting.config file add the following:
<add name="301ReDirect_For_US_Domain" redirect="Domain" ignoreCase="true" rewriteUrlParameter="IncludeQueryStringForRewrite" virtualUrl="http://www.your-domain.us/(.*)" destinationUrl="http://www.your-domain.com/$1" />
The name is just whatever you want to call the rule.
Sorry to say I was wrong about this one! The above creates a 302 re-direct, not sure if there is any way to make it do a 301, anyone?
Have a look at this forum post where this has just been discussed.
Actually... scratch that!
I just found the documentation and it is possible ( And I have fixed my re-direct :) )
You need to add: redirectMode="Permanent"
<add name="301ReDirect_For_US_Domain" redirectMode="Permanent" redirect="Domain" ignoreCase="true" rewriteUrlParameter="IncludeQueryStringForRewrite" virtualUrl="http://www.your-domain.us/(.*)" destinationUrl="http://www.your-domain.com/$1" />
And you can see this working if you open up firebug and look at the network section and then hit the following URL, as I have just updated my redirect using this.
Should 301 re-direct to:
Nice one. Ty! =)
Thanks a lot!
This works like a charm :-)
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted