How to redirect root web site to site collection
-
13-12-2019 - |
Question
I'm having quite a hard time figuring out this problem and I need your help. Here's the scenario:
I have a sharepoint 2010 web application on my port 80. This has 2 site collections, the root, and the /sites/official. My problem is: The root site is empty, but in the future it will be my something (I don't know what yet), but my other site collection is ready to go and I already have an Internet address for it.
What I want to do is configure everything in way that I can type http://contoso.com
and get as response my sub-site (yes, its a kind of redirect)...
how can I do it? What and where should I configure it?
Solution
add content editor webpart on your root site collection and put this javascript in that webpart
<script type="text/javascript">
window.location = "http://contoso.com/sites/official"
</script>
OTHER TIPS
- Open IIS manager
- Right click on your SharePoint website ->
Properties
- Go to tab
Home Directory
- Choose
A redirection to a URL
- fill the URL for redirection. for example:
http://contoso.com/sites/official
Notes:
- Make sure to check
A Directory below URL entered
to avoid redirect loop - Link to another thread might interest the reader - immediate redirect page in sharepoint
Screenshot:
Add alternate access mapping for the sub-site collection from the central administration.
Central Administration > Application Management > Web Applications > Configure alternate access mappings