0

I have created a root site collection with following url:

 http://sp.domain.com

I want to auto redirect all users who browse to the root site collection to another site collection with this url:

  http://sp.domain.com/sites/firstSite

so that nobody can use root site collection. What can be the best solution.

Thanks for advices.

Medes
  • 2,086
  • 10
  • 60
  • 103

1 Answers1

1

Add content editor webpart on your root site collection , http://sp.domain.com and put below javascript in that webpart

<script type="text/javascript">
 window.location = "http://sp.domain.com/sites/firstSite"
</script>
Anuja
  • 3,103
  • 4
  • 23
  • 27
  • Thank you, I tested your answer. It is right but for a short time users see the root site collection. I would like to redirect the users before they come to the first page of the root site collection. right now I am trying to write a http module but the disadvanteges of http module is they must be registered by editing web.config file. I tested URL-Rewrite which is created by this guy, but no success yet. http://blog.mastykarz.nl/friendly-urls-sharepoint-site-4-steps-iis7-url-rewrite-module/ – Medes Oct 22 '12 at 10:09
  • for rewriting the url plese refer: http://sharepoint.stackexchange.com/questions/12702/support-for-url-rewriting – Anuja Oct 22 '12 at 10:17
  • for writing a http module, this should help you : http://www.thedotnotcorner.com/2012/06/07/sharepoint-2010-url-redirection-rewriting-using-httpmodule-for-anonymous-web-application/ – Anuja Oct 22 '12 at 10:20