Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Redirecting URL in sharepoint

  Asked By: Srikant    Date: Oct 27    Category: Sharepoint    Views: 4683

I want to redirect all requests to portal URL.

If user gives http://servername/sites/test , automatically it should redirect to http://servername.



26 Answers Found

Answer #1    Answered By: Damon Garner     Answered On: Oct 27

Why would you want to do this? Technically you could put a web part on every page that writes a cookie. If the cookie isn’t present when it starts it redirects to the root. I just can’t think of a situation where this would be a good idea.

Answer #2    Answered By: Dameon Dejesus     Answered On: Oct 27

maybe use the CEWP to write a html redirect?

Answer #3    Answered By: Tejaswani Barve     Answered On: Oct 27

Whats happening was

User are directly going to subsites with out coming into the portal,

Actually we palced all the links in portal  home page.

We need users need to come to portal home page when accessing any sub site(WSS)

Can you suggest any solution for this?

Answer #4    Answered By: Harshita Padwal     Answered On: Oct 27

As a few good people pointed out, you’re missing the root cause of your problem here. It’s not a technology problem you have, it’s a policy one. If people are missing the portal  because they’re directly linking to subsites, they’re doing it for a reason. One suggestion is to set the users home page to the portal through a group policy then when they fire up Internet Explorer, that’s the first page they see. If they have links to sites, they’re still going to have to launch explorer to get them (unless they have short cuts on their desktops or something). Forcing them to “go to the portal” for no reason except them to come right back to where they started is just going to piss a lot of people off.

Answer #5    Answered By: Jennifer Jones     Answered On: Oct 27

Another approach might be to make the home page more attractive and useful to the user. Perhaps you could offer more relevant content in addition to the mandatory stuff. For example, you might make sure that the weather, stock tickers, sports news, etc only appear on the home page, along with the obligatory announcements. Once they are there, they are more likely to read everything.

Answer #6    Answered By: Annie Norris     Answered On: Oct 27

How to do HTML Redirect??????????????????

Answer #7    Answered By: Chadd Hahn     Answered On: Oct 27

So do you want to drive people to the portal  page or redirect  them? If you want to drive them to the home page and make them navigate down to the WSS site, a redirect won’t help as it will put them in an endless loop.

Answer #8    Answered By: Cheryl Kelley     Answered On: Oct 27

Why do they have to come to the portal  page to get to one of the sub-sites?

I did suggest a solution – it requires that you build a web part… (CEWP is acceptable if someone can figure out how to do it.)

Answer #9    Answered By: Kalyan Pujari     Answered On: Oct 27

U r correct it will be in an endless loop.

How to drive people to portal  page ?

Answer #10    Answered By: Jagdish Joshi     Answered On: Oct 27

We placed all important common content in portal  page.

But users are directly opening subsites, and they are not coming to portal home page.

Answer #11    Answered By: Shara Johnson     Answered On: Oct 27

I think you will have to build a simple web part(hidden) something like

output.AddAttribute("http-equiv", "refresh"); // do this for redirect.

and use Sessions to redirect  only once and not every time. Something like

if (Page.Session["redirectOnce"] == null)
Page.Session["redirectOnce"] = "true";
Page.Session.Timeout = 60; // you don't require this line
output.Write("Session is not set."); //
Context.Response.Expires =0;
Context.Response.ExpiresAbsolute = DateTime.Now;
Context.Response.AddHeader( "pragma","no-cache");
Context.Response.AddHeader( "cache-control","private");
Context.Response.CacheControl = "no-cache";
I have done this in the past for a different scenario. Enable sessions in the web.config file too.

Answer #12    Answered By: Christop Mcfadden     Answered On: Oct 27

Can't you just use http  equive="refresh" on the page itself?

Answer #13    Answered By: Cassidy Sharpe     Answered On: Oct 27

It sounds as though the goal is to force users to read the day's announcements. So you could set a cookie to check if they have visited the home page that day. If not, they get redirected. If so, they proceed to the subsite. This would be fairly complicated to set up, I think.

Another approach might be to push the important announcements to each sub site, if the content is not too large. Corasworks provide rollup web parts that allow you to link web parts like this. So you add an announcement on the main page, and it shows up on the subsite.

Answer #14    Answered By: Damon Garner     Answered On: Oct 27

We have the same situation and we forced to use the portal  home as the default home page for the browser organization wide.
Don't know if it helps you.

Answer #15    Answered By: Hans Weiss     Answered On: Oct 27

Effective communication and marketing. Push the portal  link to all subsites through a special link box or feature area (you can do a snazzy one using HTML in a CEWP and store it centrally so all sites can hook into it). Send out an email telling users to use the portal and reset their favorites. You will need to do end user  education.

Answer #16    Answered By: Alison West     Answered On: Oct 27

yep you will loop, my idea will not work unless you get really fancy.

Answer #17    Answered By: Freddy Heath     Answered On: Oct 27

What important information?

I am trying to warn you that this is a bad idea. You will likely have adoption
problems if you use this approach. Your users are navigating directly because
they don't value the content on the root portal. What do you think they will do
if you force them to go there?

Answer #18    Answered By: Joanna Dixon     Answered On: Oct 27

OK, your issue is not with forcing people to the portal, your issue is making sure they see the information on the portal  IF they are creating direct links into the sites.

One idea: create a web part that pulls content DOWN from the portal and stick this web part in the sites. This WP wouldn’t pull ALL the content from the portal homepage, rather it will pull excerpts and teasers.. maybe only enough to take up a small portion (15%) of the site’s homepage. You can configure it so the WP can’t be removed from the WebPartPage. This can be done by modifying the site definitions.

This way, you aren’t forcing your users to do anything, and you’re highlighting important news across your entire environment.

Answer #19    Answered By: Justine Barrera     Answered On: Oct 27

I’m still not seeing how this is a problem, other than they are accessing the content in a way that you don’t want them to. The entire point of the portal  is that is a way to get somewhere else – but if they can get “there” (wherever “there” is), then why do we care if they went through the portal?

In short, if they have permissions to the URL-location, they can go there and without doing something fancy with code, there isn’t anything you can do to stop them.

Answer #20    Answered By: Sharonda Mcfarland     Answered On: Oct 27
Answer #21    Answered By: Cory Brooks     Answered On: Oct 27

Another thing we have done with the team web sites under the portal  site diretory is to add a Portal Links Web Part to each team web site that has links to the 'important' areas on the portal top level web site. That way if someone does want to view the Job Annoucements, or the Newsleter, etc they don't have toi click 'Up to the ... ' and then cleck on the appropriate Area llink.

Answer #22    Answered By: Ruth George     Answered On: Oct 27

While I agree with the consensus, there are better ways to get people to
come to your portal. These two items may be beneficial to others:

Bob, I like your idea of using RSS and two commonly available Web Parts.
This TinyUrl may be helpful:

I also think it would be relatively easy to write a client-side cookie
with today's date in it when the user  visits the portal. If they visit
any other site before the cookie is written a JavaScript
document.location.href is set and the user is redirected and the cookie
will be written. I would probably include their original destination in
the url  so that the portal  could give them an easy link back to where
they originally wanted to go.

Answer #23    Answered By: Peter Peterson     Answered On: Oct 27

Where I work. persistenrt cookies are not allowed so the cookie solution
would only be valid for a browser session.

Answer #24    Answered By: Kalyan Pujari     Answered On: Oct 27

Why aren’t persistent cookies allowed? Did someone get attacked by a Cookie Monster?

Answer #25    Answered By: Isidro Berger     Answered On: Oct 27

I agree, persistent cookies are nothing to be "afraid" of, in fact they're quite useful for token authentication tools. Most likely it's just corporate policy that needs to be revisisted.

Answer #26    Answered By: Schuyler Le     Answered On: Oct 27

I work on a Government Contract and persistent cookies are prohibited.

Didn't find what you were looking for? Find more on Redirecting URL in sharepoint Or get search suggestion and latest updates.