19

I usually use SPUtility.Redirect when working with Application Pages or pages that need to potentially look at the source querystring or go back to settings.aspx. If I am doing a redirect other times (usually in an HttpModule), I will use the Context.Response.Redirect or HttpContext.Current.Response.Redirect. The Page.Response.Redirect is just exposing the ...


12

It could be achieved with HTTP Redirect in IIS using IIS URL Rewrite module. This module allows to create various rule actions including redirect and request abort. For your scenario i recommend this option because this should redirect the request faster as the redirection happens as soon as the HTTP request received by IIS. Configuration Let's describe ...


11

The difference between SPUtility.Redirect and Page.Response.Redirect is that SPUtility.Redirect provides many more options while redirecting. SPUtility.Redirect takes in the SPRedirectFlags enumeration as one of the parameters which gives us more control over the redirection. With it we can even keep the reference of the previous page. More details on the ...


9

You can use different ContentEditor (Script) WebParts for Each Group, set the Target Audience on each WebPart to match your groups. Inside each Webpart add a script which sets a global _MyGroupName variable _MyGroupName='A'; Add a ContentEditor Webpart at the bottom of the page which executes code for everyone switch(_MyGroupName){ case('A'): url=''; ...


8

You can use a standard HTML redirect with a wait period of 0: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>Redirecting...</title> <meta http-equiv="REFRESH" content="0;url=http://www.yoururl.com"> </head> <body> </body> </html> Changing the ...


8

There are some online-tipps which recommend the use of the IIS Rewrite module. I do not prefer this way. My preferred way is done with SharePoint AAMs and IIS-Bindings: Alternate Access Mappings: Configure your HTTPS URL in Default-Zone. Add an additional "Internal URL" and map it to the "Default" Zone. Should look like this: Add both the HTTP and the ...


6

Try it as below: if(location.href === 'https://mysite.sharepoint.com/sites/ABC/SitePages/SPage.aspx') { location.href = "https://mysite.sharepoint.com/sites/ABC/SitePages/Pages.aspx"; }


5

There's an answer on technet which explains it pretty well: Hello! When request is being redirected, the HttpResponse.End() method is called. The given method, in turn, calls Thread.CurrentThread.Abort(new HttpApplication.CancelModuleException(false)); The Thread.Abort method raises ThreadAbortException in the thread where it is invoked ...


5

You should be able to use the app_offline.htm method. Create a file called "app_offline.htm" and put it into the root directory Info here: http://weblogs.asp.net/scottgu/archive/2005/10/06/426755.aspx Also, it seems like some people have written features to help manage this: http://spoffline.codeplex.com/ or http://archive.msdn.microsoft.com/...


5

Unfortunately redirecting after an item is added isn't easy. The event receivers only allow redirecting when it's a Pre event like ItemAdding by the use of SPEventReceiverStatus.CancelWithRedirectUrl, but this cancels the adding of the item. So in order to redirect when the add is done you have to: Implement your logic in ItemAdding Retrieve all the ...


5

You "could" add a CEWP to the homepage to insert some javascript to redirect them automatically. <script> window.location.href = "https://sharepointtenant.sharepoint.com/"; </script> Ideally, if you were coming from onprem, you could add this javascript to the 404 error page and turn off all the sites so that the 404 page will redirect them.


4

I am loading an infopath form inside the InfoPath Form Web Part after clicking a link from another page. I wanted to use the Source URL parameter but found it wasn't working. Here is my solution: <script type="text/javascript"> function RedirectIfFormIsClosed(){ var elem = document.getElementById('DialogFinalMessage'); if (elem !== null &&...


4

There are several ways of doing it, one of them is Add the following code to the configuration/system.web node <browserCaps> <result type="System.Web.Mobile.MobileCapabilities, System.Web.Mobile, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/> <filter>isMobileDevice=false</filter> </browserCaps> You ...


4

i think what your refering to is Minimal Download Strategy feature. Its purpose is to speed things up by loading as little resources as possible. Minimal download strategy (MDS) is new web technology used in SharePoint 2013 to save the bandwidth traffic and quick render the pages to the clients. MDS technique use a single .aspx page (/_Layouts/...


4

Response.Redirect(TokenHelper.GetAppContextTokenRequestUrl(sharePointHostUrl, Server.UrlEncode(targetUrl))); The app redirect page


4

You want to override function PreSaveAction() instead of detecting the click with JQuery.


4

There are three ways in my mind if you are using an embedded JavaScript to redirect. 1. Use SharePoint Designer to Edit the Page directly. Change your JavaScript code and save. 2. Export the page using SharePoint Designer, make changes as required and import again. 3. In your IE settings, disable JavaScript on your browser. No JS will render and you can ...


4

When you enable variations in your site collection, there is a file created in the pages Library called: VariationRoot.aspx. When you open this file, you will be redirected to the write site. You have to set this page as your home page, so that everytime a user visits your site, he will be redirected to the correct site. You can set it has homepage either ...


4

Please try HttpContext.Current.Request.Url.PathAndQuery inplace of this.Page.Request.Url.AbsolutePath It will get you the URL with querystring parameteres


4

If changing the Source query parameter works to redirect back to the New form, why not add a script to the New form itself that rewrites the Source query param every time the form loads? That should make it endlessly redirect back to itself. Or, if that affects the behavior of the Cancel button also, use the PreSaveAction to rewrite the Source param, so it ...


3

Perhaps you can change the Welcome page to subsite homepage. To do this Go to Site Settings > Look and Feel -> Welcome Page


3

The /_layouts/spsredirect.aspx page was created in MOSS2007 to handle upgrading pages of what was known as bucketwebs in SPS2003. It'll take the oldUrl query string and see if it matches the url of a bucketweb, if that's the case it'll try to find the url of the corresponding upgraded site and if it finds it redirect the user to it. If you didn't create ...


3

You can't show a message from ItemXXXed and you can't cancel either. If you need that then you should implement ItemXXXing. You can't cancel because the changes has already been made and you can't show a message because the UI isn't waiting for you (unless you specify synchronous, but still I don't expect SharePoint to look at Status)


3

please refer to this answer that i answered about the minimal download stratergy ;) External access gives a blank home page to stop it do the following: go to: Site settings > under Site Actions section > manage site feature now disable the feature MDSFeature and it will keep on that link instead of redirecting ;)


3

A slightly different approach that gives you something along the lines of what you want, is to use Host Named Site Collections (HNSC). You could create a HNSC Site Collection called http://mysubdomain.example.org and create sites below that: http://mysubdomain.example.org/site1 You can only create HNSC using PowerShell, not GUI: New-SPSite 'http://portal....


3

Thank you for checking my question. I have found the answer in MSDN forum. I have get it to work. I have put one statement which disables Minimal Download Strategy. SPContext.Current.Web.EnableMinimalDownload = false I kept this in page load. So the time my page gets loaded it disables the effect of the SharePoint Minimal Download Strategy. The Feature ...


3

This can be done by specifying a Return URL in the form URL by providing a value to Source querystring. For example: http://<site>/Announcements/Forms/NewItem.aspx?Source=http://<site>/default.aspx Here when a user clicks on OK button in Announcements New form, the user is redirected to deafult.aspx page rather than the AllItems.aspx page of ...


3

After searching over internet four hours I found one thing. That it is not possible to make alias of the url because the site collections lie within same web application. So, that way was not possible for me. The final solution is to create an HttpModule for web application that checks specific url, if it meets the condition then redirect that request to ...


3

I am thinking following options. As your Site collection is HSNC base. why not create another url, Lets say b.site.com and set that to your /sub site collection. Move the /Sub site collection to root level using backup and restore. lastly you can think about the Vanity URL and configured it to your IIS.check this or this


Only top voted, non community-wiki answers of a minimum length are eligible