I tried using the Umbraco Redirect which does the job. But then I could not get to the home.aspx any more, which contains content as well. In addition, using the Umbraco Redirect leaded to interferences with the Search functionality.
Does someone know how to change the landing page without blocking the home.aspx?
This will redirect the root url (and just this one because of the '$' at the end) to /news-events/news.aspx.
If you want to make the destination editable in the CMS you could create a field on your web site's root node as a content picker, then write a .Net control that checks if the user has requested the domain root (www.domain.com) and redirect to the destination url.
This should redirect the user to /news-events/news.aspx when he visits /home.aspx.
I have tested the first rewrite rule on my local 4.5.1 installation before posting it, so I'm pretty confident about that. You might want to try out and remove the / altogether from the first rule and see how that goes, not sure if that is needed or even matters.
Okay, tried it out on my current 4.0.4.2 build and it worked fine for me. Very odd. The only difference I can see at the moment is that I use directories as Urls, which means your 'news.aspx' is just 'news' with me. It might be that the url rewriting does only get called when you specifically request something with .Net (e.g. aspx) which doesn't happen at root level. What version of IIS are you working with? If it's IIS6 it might be worth adding wildcard mapping to your web site and see if that makes a difference. If you are using IIS7+ are you using classic mode or integrated pipeline?
Different landing page
Hi there,
i have got the following problem and I wondered whether someone could provide me a good hint on how to move on:
At the moment when the visitor enters my domain, say for example www.domain.com he gets forwarded to the www.domain.com/home.aspx page.
Is there a way of diverting the visiter, so that when he enters on www.domain.com he lands on a different page, like for example www.domain.com/news-events/news.aspx ?
I tried using the Umbraco Redirect which does the job. But then I could not get to the home.aspx any more, which contains content as well. In addition, using the Umbraco Redirect leaded to interferences with the Search functionality.
Does someone know how to change the landing page without blocking the home.aspx?
Thank you very much in advance for your help.
Hi Edi,
you can add a custom Url rewrite rule in /config/UrlRewriting.config like so:
This will redirect the root url (and just this one because of the '$' at the end) to /news-events/news.aspx.
If you want to make the destination editable in the CMS you could create a field on your web site's root node as a content picker, then write a .Net control that checks if the user has requested the domain root (www.domain.com) and redirect to the destination url.
Hope that helps,
Sascha
Hi Sascha,
thanks for you reply.
I have added the custom Url rewrite rule as described, but somehow it has no effect.
Do you know why?
Hm, have you tried restarting the web site? Maybe try out the following just for fun to see if any rewrite rule works:
This should redirect the user to /news-events/news.aspx when he visits /home.aspx.
I have tested the first rewrite rule on my local 4.5.1 installation before posting it, so I'm pretty confident about that. You might want to try out and remove the / altogether from the first rule and see how that goes, not sure if that is needed or even matters.
Please let me know how it goes,
Sascha
OK, trying your 2nd example worked. I managed to get transfered to my news page when clicking home.
I then changed it back to your original code and it did not work again.
Then I tried virtualUrl="^~/" and virtualUrl="". In both cases I got transfered to my custom 404 Error page on all pages in my website.
I am using umbraco v 4.0.4.2.
Okay, tried it out on my current 4.0.4.2 build and it worked fine for me. Very odd. The only difference I can see at the moment is that I use directories as Urls, which means your 'news.aspx' is just 'news' with me. It might be that the url rewriting does only get called when you specifically request something with .Net (e.g. aspx) which doesn't happen at root level. What version of IIS are you working with? If it's IIS6 it might be worth adding wildcard mapping to your web site and see if that makes a difference. If you are using IIS7+ are you using classic mode or integrated pipeline?
Good morning Sascha,
I have IIS6 installed on the webserver. I now added the wildcard mapping and everything works fine now.
Thank you very much for your time an help, I really apreciate it.
Regards,
edi
Hi Edi,
great to hear that it worked out. :)
All the best,
Sascha
is working on a reply...