Click here to Skip to main content
15,887,485 members
Everything / Redirection

Redirection

redirection

Great Reads

by Dan Randolph
Builds on the existing RunRemote project to run commands on a remote server.
by Ben Baron
Java source code to demonstrate Executable Integration which is a concept of integrating several distinct executables to create a single application
by ASP.NET Community
I had a problem with assembly redirection in web.config, when i wrote assembly redirection in the machine.config it worked perfectly, where as when I
by Samer Aburabie
The article is about how to post json data to ASP.NET MVC action and be redirected to that page.

Latest Articles

by Samer Aburabie
The article is about how to post json data to ASP.NET MVC action and be redirected to that page.
by ASP.NET Community
I had a problem with assembly redirection in web.config, when i wrote assembly redirection in the machine.config it worked perfectly, where as when I
by Sunil P V
How to access a 64bit registry key from 32bit built application in .NET 3.5 and lower
by Ben Baron
Java source code to demonstrate Executable Integration which is a concept of integrating several distinct executables to create a single application

All Articles

Sort by Updated

Redirection 

29 Jan 2023 by kk2014
Hi All suppose i have two sites are https://test.com and http://test.com. Earlier, my files were on http://test.com (non-secure) now i have migrated them on https://test.com (secure). So now there are no files on http://test.com (non-secure). ...
12 Sep 2022 by Bill Mayheptad Ritchie
Hello coders in the house. I am a complete beginner, i saw something on thewpclub. Net and i want to implement the same on my WordPress blog. When someone click a download link, i want another browser tab to open and display a countdown timer like 15 seconds before the main download link will...
12 Sep 2022 by Member 15765378
I Have this same question and i found a lot but didn’t fount the correct answer , pleeease let me know if you got any solution.
4 Jul 2022 by Member 15696853
after deleting records it is not redirecting to the page I wanted instead it is showing me an error. But after going back and refresh the page the record is deleted successfully. Here is the code : - html page :
30 Jun 2022 by Member 15692350
I was wondering if there was a way to create a simple index.html page and redirect it to a hosted PDF based on mobile and desktop devices? My website is not up yet but i want people to at lease see the menu. So example now i have the site...
30 Jun 2022 by Dave Kreskowiak
In a word, "don't". Do not redirect to a PDF. That doesn't show a page but triggers a download by the browser. Users will look at that and think you just redirected them to malware. You ALWAYS make sure the user knows what is coming with the...
27 Mar 2022 by Member 15576737
I know little about code and have been spending several hours of my spare time online reading about redirects and regex. However, I'm still confused and am unsure if I'm even trying to solve my problem correctly. When nothing is entered into the...
21 Dec 2021 by Member 15475112
Hi, I have been trying to convert my http web links to https using rewrite module. The redirection seems to partially work as the links are converted with https, but then the target url is not as expected. That is, the original url:...
16 Jun 2021 by crypto88
I need 301 redirects to parent categories via .htaccess file or via plugin in WP: /parent-category-1/item-1/ -> /parent-category-1/ /parent-category-2/item-1/ -> /parent-category-2/ /parent-category-3/item-1/ -> /parent-category-3/ ......
28 Jan 2021 by Mauzz13
I want to use Response.Redirect("url") to go to keycloak and then back and process the return url from the browser. But, when kecloak send the response, my view load again and execute the Redirect too. So, the infinite loop occurs. Thanks What I...
28 Jan 2021 by raddevus
Here's your code: Response.Redirect("urlToKecloakRealm",false); string url = Request.Url.AbsoluteUri; //I want catch the response url, but this is not happening. Did you notice that you said you want to "catch the response url, but this is not...
31 May 2020 by phil.o
The href attribute of the a tag is what should hold the address of your homepage. Plus, you didn't close the img tag properly:
31 May 2020 by Member 14849113
I used an html code, and the reference to the logo is linked to an image hosting site. I'm thinking because the image doesn't come from the root directory, trying to redirect the path of the image from that hosting site to my homepage will be...
1 Mar 2020 by Vaclav_
The attached snippet processes hcitool scan, with options and REDIRECT the standard output to BOTH screen / console ( Eclipse IDE term ) and system file (temp_file.txt ). 1. Why is it necessary to add 2 into redirection ? Why not ">@1" ? 2....
1 Mar 2020 by Richard MacCutchan
That is nothing to do with HCI it is standard Linux shell scripting. The "2>&1" tells the shell to send all output that would normally go to stderr to stdout. The "|" (pipe symbol) says to pass all output (i.e the combined stderr and stdout) to...
10 Feb 2020 by Amogh Natu
Hi all,I'm facing a really weird scenario here with my local IIS. I have hosted multiple sites in the default website in my local IIS. One of them has the login page. From the login page, I'm redirecting the user to another page that is located in another site (which is also hosted in the...
8 Nov 2019 by #realJSOP
0) The delay does not go on the page where the user clicked the link - it goes on the page that has the download button. 1) To make a link open in a new tab, add target="_top" to the href. 2) You should respond to an event in order for the html to be rendered. 3) For the record, these...
8 Apr 2019 by #realJSOP
301 redirects in asp.net - Google Search[^] In that search result, I went here: Jeff Widmer's Blog - How to 301 Permanent Redirect in ASP.NET[^] The first response might be appropriate in your case, but only you can determine that.
8 Apr 2019 by Member 13709557
I have to redirect some old pages to new page using ASP.NET without MVC old page url: abc.com/how-to-301-permanent-redirect-in-asp-net/ new page url: abc.com/blog/301-permanent-redirect-in-asp-net/ I'd like to manage the old and new URLs in a redirect map file maybe a csv or xml. The old...
1 Mar 2019 by F-ES Sitecore
You're going nothing with the ReturnUrl param in the HttpGet. In order for that to be available in the HttpPost you'll need to store it in the form. Amend the LoginViewModel class to add a ReturnUrl property public string ReturnUrl { get; set; } Capture the url in the HttpGet method and...
1 Mar 2019 by Member 14168150
I'm working on an MVC app that has login authentication and times out after a while of being logging in. So I want to be able to log in and go back to the page I was rather than going to a static home page. Every time I get kicked out, I do get a "Account/Login?ReturnUrl = ... " on my...
22 Oct 2018 by MadMyche
There are a multitude of ways that redirects can be handled. The order that these are in is signifigant in the fact of how much application overhead is created, if any; the less overhead that is onvolved the more performance your website will have. 1. At the (web) server level. This would be...
22 Oct 2018 by Mr_cool
I want to manage 301,404 and other redirects. I can create a table in the sql server database (which will contain the old and new url). How to call them in the front end server when anyone hits the old URL. Solution for non-MVC preferred. Should be fast. I appreciate any help. Thanks. What I...
22 Oct 2018 by #realJSOP
You could specify a custom 301 and 404 error page in the web.config, and in the code behind for that page (in the PageLoad method?), evaluate the 404 response, which should include the faulty url, and write code to redirect to the appropriate page. So, if the bad url was...
22 Oct 2018 by #realJSOP
Using a database to manage this is - well - stupid. Google will provide a wealth of alternatives, such as this one. How to automatically redirect a browser to another web page from one of your own[^]
6 Jun 2018 by F-ES Sitecore
Try the suggestion here How to make a catch all route to handle '404 page not found' queries for ASP.NET MVC? - Stack Overflow[^]
6 Jun 2018 by Member 13860593
Like the title says, I want to be able to display an error page and send a 404 header while keeping the url of the page that could not be found. What would be a good approach for achieving this? What I have tried: I've looked at attribute routing bu can't seem to wrap my head around how I...
27 Mar 2018 by Andy Lanng
Updated to 2017: using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Threading; namespace ProcessWithOutput { public class ProcessWrapper : Process, IDisposable { public enum PipeType { StdOut, StdErr } public class...
27 Mar 2018 by Johannes Grunedal
Hi! I have a C# application which communicates with a console window (via SetForegroundWindow and sendKeys). This works great and I use that for sending commands to the console window (I also start another DOS program inside the command prompt).The PROBLEM is that I would like to read back...
6 Jan 2018 by Member 1097736
I have to restrict access to particular action in a controller and so i have created a RestrictAccess attribute which implements ActionFilterAttribute . RestrictAccess public class RestrictAccess : ActionFilterAttribute { public override void...
6 Jan 2018 by Bryian Tan
In the HandleUnauthorizedRequest method try using the following syntax and make sure you register the filter (RestrictAccess) in the FilterConfig filterContext.Result = new RedirectResult("~/Test/RedirectToError");
20 Sep 2017 by Member 13420036
I had the same problem, but resolved it in the binding. In my case I had two ip addresses but only one was bound when the website was created. It was resolved by adding a second binding that featured the 2nd ip address.
23 May 2017 by Member 13217455
Hi, For a client I want to do the following thing with .htaccess: domainname.com/path must redirect to sub.domainname.com/path, but only if the first page is a deleted page / 404 page. So all the existing pages must stay intact, and the deleted pages must redirect to a subdomain with the same...
18 Mar 2016 by Nicholas Marty
I have a small question where my search fu has left me without an answer.Example situationI'm owner of the domains "example.org" and "www.example.org"I want to redirect "example.org" to "www.example.org"There already exists a website in IIS 8 that handles both domainsWhat I...
18 Mar 2016 by Sunasara Imdadhusen
HiYou have to install URL rewrite module for IIS and then use following:
28 Jan 2016 by Anurag Gupta
I need to 301 redirect urls like this:example.com/exam/anythingexample.com/anythingmy current .htaccess file RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /admin/index.php?$1 [L]i do not know how it work
22 Jan 2016 by Member 12281095
My website has database files in root domain. I also have a mobile domain as m.example.comI already included CORS and it is working in desktop website and mobile website if viewed in desktop. But my .htaccess files redirect each request to mobile sub domain on mobile devices.I am making...
9 Jan 2016 by KarstenK
I would go for named pipes as desrcibed in this article.On your code: Are the apps running at the same time, or is the launcher (A) waiting for the termination of B.
9 Jan 2016 by Zaraki21
I am working on a C++ application and I am encountered a problem. See below a brief description of my application :There are two processes which work together. The main process (application A ) calls the second one (application B) which is the child of the first one.Application A :...
5 Oct 2015 by Kiran2401
Hi Sir,I have a problem with my project. My Problem is: If a non administrator tries to access the Admin section, he should be redirected to an error page : "ErrorPage.aspx". I have created "ErrorPage.aspx"But, in my Program, Unauthenticated (Non Admin) user is redirected to Login...
26 Aug 2015 by ADS14
Hi ,I am working in Nintex Workflow, is there is any way to direct the workflow status page from list using c# code. ?Thanks in advance
17 Apr 2015 by Andy Lanng
I want 5 start ^_^This is a whole class. It doesn't use any assemblies outside of the standard libraries. it can be made even nicer with RX for example, which allows you to turn events into IEnumberables in a much better way that I have done here.If your looking for that, search for...
17 Apr 2015 by Andy Lanng
There are two parts to a process run in a cmd terminal: the process and the terminal itself.When you run a command in the terminal, that command will output to a buffer. if that buffer gets full then the process waits for the buffer to be read so it can continue.The terminal reads from...
1 Apr 2015 by Member 11574780
I'm doing this: net stop wuauservthen:rename c:\windows\SoftwareDistribution SoftwareDistribution.oldand then: mklink E:\windows\SoftwareDistribution \DI'm doing `\d` in the end because otherwise it doesn't work and \d because of the same reason.and then: ...
27 Aug 2014 by Tejas Vaishnav
=> Do one thing, you can create some session which is only contains valid data when user has finished steps over first page.=> check that session in your second page load event, if that session is valid then allow user to access second page, other wise redirect to first page again.the...
27 Aug 2014 by Member 10915623
Hello guys,Let's say when I run my web application on my locahost, and the url in the broswer is like ~/Page1.If the user changes the url from "~/Page1" to "~/Page2", they will be redirected to "~/Page2".Is there any way for me to prevent this url modification? Since I need the user...
27 May 2014 by Sergey Alexandrovich Kryukov
This file, .htaccess is the Apache file, but you probably use IIS. Your purpose is not quite clear, but try to start here:http://support.microsoft.com/kb/2818415[^].See also: http://en.wikipedia.org/wiki/Rewrite_engine[^].[EDIT — after OP's clarification]There is a lot of...
27 May 2014 by cawboy_iran
hello.can i use ".htaccess" file for redirecting and other thing in sharepoint 2010 site?If Yes tell me how?If Not Please Advice Me.Thanks
14 May 2014 by Samer Aburabie
The article is about how to post json data to ASP.NET MVC action and be redirected to that page.
17 Apr 2014 by Peter Leow
Refer: 1. Similar discussions[^]2. Server.URLEncode Method[^]
17 Apr 2014 by Sanket Saxena
You need to encode/decode url.String url = "http://www.red.com#hashthatstays";string encodedURL= HttpUtility.UrlEncode(url);Response.Redirect(encodedURL);
17 Apr 2014 by DamithSL
try with UrlEncodeResponse.Redirect(HttpUtility.UrlEncode(url));
17 Apr 2014 by Bob@work
I wasn't able to duplicate the problem using response.redirect(urlstring):Dim gotourl As Uri = New Uri("http://www.red.com#hashthatstays")Response.Redirect(gotourl.ToString)...arrives at the page http://www.red.com#hashthatstaysHowever, if the file you're linking to has a hash in...
13 Apr 2014 by Didier Monge
I am having a problem when I try to use the response.redirect(url) and the url has the # character ... the webserver is taking out the # character plu any character that is after the #Any idea how i can handle it
10 Mar 2014 by ttddssg
I want to compile a java program using batch file. Code works if the program does not need any input but creates a deadlock condition when it needs input Here is the code:public void compilefile(ref System.Windows.Controls.RichTextBox rtb,ref TabItem tabitem) { var range = new...
6 Feb 2014 by arnavut
I have IIS 7 that serving several site on it. Only one site has SSL certificate (For example: ssldomain.com). But when i visit any other site with https, IIS show me ssldomain.com.Thanks.
20 Jan 2014 by Thomas Daniels
You can use JavaScript[^] to do that:if (!document.referrer.endsWith('index.html')){ window.location.replace('index.html');}Hope this helps.
20 Jan 2014 by Richard C Bishop
Well, first off, HTML is not a scripting language with functionality. You will need to use JavaScript, Classic ASP, or some other scripting language to accomplish this task. It is pretty easy in Classic ASP. You can do exactly what you want. Just do some research.
20 Jan 2014 by Member 10536511
How to write an "IF" condition in html to redirect to index page "if" visitor is not coming from index page.
19 Jan 2014 by Frank1982
I was going from search-by-typology.aspx towards article.aspx but in the article's codebihind I have got a response.redirect(search-by-typology.aspx) old style redirect and it was going back so when I have commented that row the issue disappeared.I hope this help someone else.Thank you...
18 Jan 2014 by Frank1982
Hi guys, I am getting an error in a routed page when I click on a link that should open another routed link, but it seems that the code makes a loop I don't understand why and where.Here the code in the global.asaxSub RegisterRoutes(ByVal routeCollection As RouteCollection) ...
30 Dec 2013 by Shubhashish_Mandal
Try this....
28 Dec 2013 by hamed1991
Before starting, I'm sorry for my bad English, because English is not my first language. However, I have a problem with Struts 2 redirecting.One part of my Struts.xml file is like this:
20 Nov 2013 by ravithejag
Hi,i am developing a WCF REST Service,I have a requirement in that if any error occurred while performing CRUD operations or no data present while fetching data in WCF REST services.It has to redirect to the error page and show respective error messages on the screen.Thanks and...
25 Oct 2013 by saddam Escape
in your c++ console application use cout.flush() instead of cout
21 Oct 2013 by Amogh Natu
Indeed, the problem was with the way I had hosted the sites in my application. I just removed all the sites related to my application from IIS and then hosted all of them again much more carefully. This resolved the "wrong redirect url" problem. Also, I had some tables with missing required...
11 Oct 2013 by ASP.NET Community
I had a problem with assembly redirection in web.config, when i wrote assembly redirection in the machine.config it worked perfectly, where as when I
1 Oct 2013 by Homero Rivera
Tryhttps://support.google.co...
1 Oct 2013 by Member 4445346
I have two seprated profile for domain.com and m.domain.com (mobile version web site) in analytics.and we using redirection in domain.com for mobile devices to redirect mobile users to m.mobile.com.so regarding to this strategy we prevent all search engine bot and crawlers( with...
16 Sep 2013 by Zubair Alie
It seems that you have any of following scenarios running with you1- Request was arrived on the right page "Console.aspx". But inside errorHandling you received code 5 and then you redirected it to page CPLogin with querystring parameter err=5. [and while redirection your redirect URL goes...
15 Aug 2013 by fjdiewornncalwe
Using web-config-custom-httperrors[^] as a reference, I noticed a small difference in your config from what is described there. I'm not entirely sure if it is relevant at all, but you are missing subStatusCode="-1" in your remove statement.
15 Aug 2013 by Vipul Mehta
Hi,When user tries typing any folder from URL (www.mydomain.com/foldername), browser throws following server error "403 - Forbidden: Access is denied.". With this message, attacker can get an idea that there exists such folder name and might try attacking or exploring it. When there is any...
8 Jul 2013 by salders
I've encountered the same issue. You can capture ALL of plink's command-line output by executing it through a windows shell script. eg.Set objShell = WScript.CreateObject("WScript.Shell")Set objExecObject = objShell.Exec("cmd /c C:\tools\plink -load "& WScript.Arguments(0) &" "&...
20 May 2013 by Sunil P V
How to access a 64bit registry key from 32bit built application in .NET 3.5 and lower
17 May 2013 by kk2014
hi all,i found the solution...i code this in my master page and it worls for me.please see below code:if (System.IO.Path.GetFileName(HttpContext.Current.Request.PhysicalPath) == "test.aspx" && showWebbkg == 1){ HttpContext.Current.Response.Redirect("Home.aspx");}
17 May 2013 by Mahesh Bailwal
One of the way to do this, is to use Global.asax BeginRequest event as given below or you can create Base Page and derive all the aspx pages on which you want to stop user to come directly.In load method of base page you validate user request and redirect them to home page.protected void...
16 May 2013 by Mahesh Bailwal
On every page make a check whether DB value is true, if it is true then redirect to Home Page.
16 May 2013 by kk2014
Hi all, On login if one of my db value is true then i don't want to show a menu which is redirecting to certain page, i did it.but if someone knows page name and write direct to address bar then he/she can go to that page.so how can i do it if someone write page name to address bar but...
7 May 2013 by Gianmaria Gregori
Maybe could help the approach used in this tutorial[^]:- create a subfolder (e.g. Members);- put files you want to protect into this subfolder;- in the Members subfolder, create a file named _PageStart.cshtml. When any page in the subfolder is requested, this page runs first;- in the...
6 May 2013 by cs101000
When I run optimization report for my webmatrix website, I get multiple issues stating:"the page contains unnecessary redirects". This is the code snippet that causes the problem: if(!WebSecurity.IsAuthenticated) { //navigate to login page ...
21 Mar 2013 by Janani Muthaiyan
I need to do Page redirection of 303 status code in asp.. When I provide the tempURL(manually generated) in browser the link has to be automatically redirected to the original URL.. I will be having DB for each tempURLs and corresponding original URL.. I need the dynamic page redirection.....
20 Mar 2013 by _Amy
So you should go for Custom Errors in ASP.NET[^]Try this: Also check Displaying a Custom Error Page (C#)[^].[Edit]Try this in your master...
20 Mar 2013 by Mohd. Mukhtar
Try below codestring url = Request.Url.ToString(); Get actual Url from Db.Add status code to the response url.Redirect user to the page.And what have you tried so for??
20 Mar 2013 by Gopinath_Rajan
Try this Response.RedirectLocation = url; Response.StatusCode = 303;For Ur Reference http://stackoverflow.com/questions/9497467/how-to-create-303-response-in-asp-net[^]
9 Nov 2012 by kk2014
hi all,i am not able to redirect/login to my owa page. when i run my code below commandd windoe comes and disappears nothing happens.please seemy code belowSub main() Dim strServerName As String = "12.345.56.789" ' my owa ip Dim strPassword As String = "password" 'my...
11 Oct 2012 by AshishChaudha
Try following code in global.asax //This code work only on server void Application_BeginRequest(object sender, EventArgs e) { if (HttpContext.Current.Request.Url.ToString().ToLower().Contains("http:")) { ...
11 Oct 2012 by Mario Majčica
There are several methods to do this. Check this link:http://www.sslshopper.com/iis7-redirect-http-to-https.html[^]I think that the simplest one is setting up a custom error page. Try and let us know!Cheers
11 Oct 2012 by AmitGajjar
Hi,You can even redirect your site using DNS entry from your server. That way you do not have to keep default page on your old site. just made one entry to redirect page on the new https location. If you want to redirect using your default page then you can use Response.Redirect to...
8 Aug 2012 by vit01982
Hi guys,I got an htaccess question, hopefully you could help me out:When I have a querystring parameters in URL, I have to make a redirection to the same page without these parameters.Example:http://sos-med.com/en/our-offices/endokrinologiya.html?print=1&tmpl=componentmust...
1 Aug 2012 by pradiprenushe
This can be done in two ways.1. When you login create session (in login page login button click)likeSession["user"]= txtUser.Text;Write below code in page which you have to make secure.Protected void Page_load(object sender,EventArgs e){if(Session["user"] ==...
1 Aug 2012 by Prafulla Sahu
hi I am new to this .net world so find some problems sometime please help me to overcome this.I have a hyperlink and its navigate url indicates to a secure page ,and that secure page is present inside a folder.user can see this page after his/her successful login.so my requirement is when...
25 Jul 2012 by Pankaj Nikam
What you can do is to have a page where it redirects normally and you can use client side code to point to the file. In that way the browser will show the URL and the download will also be possible.
25 Jul 2012 by Rene Bustos
You've tried to setTimeOut within the download.aspx? I mean, when do the redirect to the page Download.aspx in on_load method (codebehind) or javascript (client) of this download page, a few seconds and call again to send the page with a parameter that makes it download the file that way you can...
24 Jul 2012 by Prafulla Sahu
I have a page which has a LinkButton,my requirement is when i click on 'DownLoad; Linkbutton the page should redirect to another page and there my file should be download and my web page address bar should display that which page it is redirecting also my querystring value. please suggest me how...
4 Jul 2012 by arielbeck
Hello, according to this:http://www.websense.com/content/support/library/data/v76/help/Edit%20SMTP%20enc.aspx[^]i can redirect requests to a gateway server.can i instead of it sae the eml files in filesystem?thanks!
27 Jun 2012 by Dec90
I'm no expert but you could request the referrer http header from the client.http://msdn.microsoft.com/en-us/library/system.web.httprequest.headers.aspxmay help.
27 Jun 2012 by Mohammad Reza Valadkhani
hi everyonerecently I`ve found that some other sites redirect to my websiteas an example my site name is mysite.com but another one who has same domain like mysite.org redirects to my address , i don`t want users redirect from mentioned address to my website , i`d really appreciate if anyone...