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
Hi,
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.
_Frej
Hi Frej,
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.
Cheers,
Chris
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.
http://our.umbraco.org/forum/using/ui-questions/5255-301-redirect-options
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"
E.g.
<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.
http://www.nursingpersonnel.co.uk
Should 301 re-direct to:
http://www.nursing-personnel.co.uk
Nice one. Ty! =)
Thanks a lot!
This works like a charm :-)
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Primary domain in Umbraco
Hi,
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.
_Frej
Hi Frej,
You can do this by using the built in URL re-writing.
In the UrlRewriting.config file add the following:
The name is just whatever you want to call the rule.
Cheers,
Chris
Hi,
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.
http://our.umbraco.org/forum/using/ui-questions/5255-301-redirect-options
Cheers,
Chris
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"
E.g.
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.
http://www.nursingpersonnel.co.uk
Should 301 re-direct to:
http://www.nursing-personnel.co.uk
Cheers,
Chris
Nice one. Ty! =)
Thanks a lot!
This works like a charm :-)
_Frej
is working on a reply...