Is umbraco setup to handle http://sctflash.com and http://www.sctflash.com – I have IIS being able to handle both but for non-www urls umbraco is showing a 404 page. Try
I tried entering http://sctflash.com and http://www.sctflash.com in the hostnames, but it still didn't work. I was going to try your rewrite rule next. Will this only work for POSTS? What about GETS?
I actually never fixed it. Adding both hostnames, sctflash.com and www.sctflash.com didn't do anything and the rewrite rule didn't fix it (it threw a 500). I have yet to try your solution yet. How would I be able to redirect sctflash.com to www.sctflash.com and bullydog.com to www.bullydog.com for both the root of the website and nested pages so http://sctflash.com/products/search becomes http://www.sctflash.com/products/search
Essentially, you need both addresses in the bindings in IIS.
Then in your urlrewriting config you add a rule to go from the non www address to the www address.
<?xml version="1.0" encoding="utf-8"?>
<urlrewritingnet xmlns="http://www.urlrewriting.net/schemas/config/2006/07">
<rewrites>
<!-- Use this rule to redirect a url without www at the front to one with www at the front. - From http://codeshare.co.uk to http://www.codeshare.co.uk -->
<add name="NoWWW" virtualUrl="^http\://codeshare\.co\.uk/(.*)" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="http://www.codeshare.co.uk/$1" redirect="Domain" redirectMode="Permanent" ignoreCase="true" />
</rewrites>
</urlrewritingnet>
redirect non-www urls to www urls
I get 404 when trying to go to a non-www url:
Is umbraco setup to handle http://sctflash.com and http://www.sctflash.com – I have IIS being able to handle both but for non-www urls umbraco is showing a 404 page. Try
http://sctflash.com/products/search for example. For http://sctflash.com and for http://bullydog.com I setup a redirect to the www url but I can’t do that for every single page. Can umbraco handle both.
Umbraco can handle both, if you ask it to do so.
Just add the domains to the page you want it to show.
Right click the page and choose "Culture and Hostnames" and add both domains here.
Or you could in your web.config file add the following under system.webServer
This will redirect all non-www to the equivalent www url, and respond with a 301 Permanent Redirect.
Hi Sebastian,
I tried entering
http://sctflash.com
andhttp://www.sctflash.com
in the hostnames, but it still didn't work. I was going to try your rewrite rule next. Will this only work forPOSTS
? What aboutGETS
?Adding this rule actually threw a 500 error.
Thank you Sebastian.
What if i wanted to redirect a domain alias to main domain, how would i construct the rule? I mean to redirect mysite2.com to www.mymainsite.com.
Best regards...
Looks as if you fixed it.
But it can also be done in UrlRewriting.config
First rule is from non-www to www
Second rule is to redirect from with trailing slash to no trailing slash.
So that i.e this URL
http://www.sctflash.com/products/search/
also would work
Hi Michael,
I actually never fixed it. Adding both hostnames, sctflash.com and www.sctflash.com didn't do anything and the rewrite rule didn't fix it (it threw a 500). I have yet to try your solution yet. How would I be able to redirect sctflash.com to www.sctflash.com and bullydog.com to www.bullydog.com for both the root of the website and nested pages so http://sctflash.com/products/search becomes http://www.sctflash.com/products/search
Hi Saied
Have a look at this blog post, it should help you out. http://www.codeshare.co.uk/blog/how-to-create-url-rewrite-rules-in-umbraco/
Essentially, you need both addresses in the bindings in IIS.
Then in your urlrewriting config you add a rule to go from the non www address to the www address.
Just to remember that Urlrewriting was removed in version 7.7.x. I also do not recommend it. I had recent problems where it caused 100% CPU.
I migrated to the IIS Url Rewrite
is working on a reply...