redirect

Javascript to redirect from #anchor to a separate page

I have a set of links with #anchors pointing to a single webpage and I would like to smoothly move to a model with a separate webpage for each of those links. I want the old links to keep working using a redirect. Old link style: /all_products#A /all_products#B /all_products#C New link style: /products/A /products/B /products/C I ...

ASP.NET Persist POST data through login redirect

I have a site (SiteA) using ASP.NET membership. One thing that it must do is allow the end user at a separate site (SiteB) to launch a new browser window to a page at SiteA with POST data attached to prefill the page. If the user is logged into SiteA, then the launch from SiteB works and the page is prefilled. However, if the user is ...

$_SESSION difficulties

I am creating a login script that stores the value of a variable called $userid to $_SESSION["userid"] then redirects the user back to the main page (a side question is how to send them back where they were?). However, when I get back to that page, I am echoing the session_id() and the value of $_SESSION["userid"] and only the session i...

ruby on rails redirect_to(:back) not working

Following some code in Agile Web Development book, theres a method to redirect back to the last viewed page using redirect_to(:back), however when I do that it simply returns back to the page it was on. Whats the best way of getting the desired result to work? Am I doing something wrong? My code: def update @user = current_user if @use...

Getting "mywebsite.org/" to resolve to "mywebsite.org/index.php"

At my work we have various web pages that, my boss feels, are being ranked lower than they should be because "mywebsite.org/category/" looks like a different URL to search engines than "mywebsite.org/category/index.php" does, even though they show the same file. I don't think it works this way but he's convinced. Maybe I'm wrong though...

Is there any way to redirect stderr output from a command run with “start” in the Windows command line?

I have a program that I want to automate runs for, since it takes awhile to complete. For some reason it outputs everything to stderr instead of stdout, and I'd like to check on its progress, so I find myself needing to redirect stderr output within a start command. I tried this: start "My_Program" "C:\Users\Me\my_program.exe" --some -...

Is there any way to redirect stderr output from a command run with "start" in the Windows command line?

I have a program that I want to automate runs for, since it takes awhile to complete. For some reason it outputs everything to stderr instead of stdout, and I'd like to check on its progress, so I find myself needing to redirect stderr output within a start command. I tried this: start "My_Program" "C:\Users\Me\my_program.exe" --some -...

Redirect to new page w/ POST data (PHP/Zend)

I'm trying to figure out how to redirect to a new page (different application, controller, action) and maintain the current POST data. My app is validating the POST data and if a certain criteria is met, I want to redirect to a different location, but make sure the POST data is passed as POST data to that new page. Here's a rough exampl...

Struts2 dynamic parameter name in redirect-action

I'm successfully using a redirect-action for one of my struts2 mapping files as follows: <action name="setAsCurrentCart" class="com.fmp.MyAction"> <result name="success" type="redirect-action"> <param name="actionName">myOtherAction</param> <param name="foo">${foo}</param> </result> <interceptor-ref name="defaultComponentS...

Redirect ALL requests under a domain to static page - .htaccess or 301 or RedirectMatch?

Hey everyone, I am trying to redirect ALL requests for mydomain.com whether they are something like: http://www.mydomain.com http://mydomain.com http://mydomain.com/photos http://mydomain.com/index.php?id=672 to be redirected to http://mydomain.com/index.html As long as it has mydomain.com in it, they should see this page - its...

Troubleshooting an infinite redirect in a web application

I have a web application that is trying to redirect in a loop, and Firefox is telling me that it is stopping because the request will never complete. Is there a good way (in Firefox) to see what URL is being requested in this never-ending loop? The address doesn't seem to appear in the address bar. Are there any addons that can help with...

How to REDIRECT a web Page for every ten seconds

In simple there is any way to redirect a page for every ten seconds in PHP ...

accidental framebusting

I have an MVC web app where I'm redirecting in the Application_AuthenticateRequest in order to authenticate using this code: string[] tokens = Regex.Split(url, "(returnurl=.*default.aspx)"); Response.Redirect(url.Replace(tokens[1], "r=/")); It works fine on its own, but I need to host this app entirely within a...

To inform users of denied access, is it better to redirect to a different page/document using HTTP headers or is it best to incorporate a message in the dynamic page?

I would like to know what is the best practice for informing a user that their access attempt was denied. I realize there are probably more options, but these are the methods I'm considering: Inform a user on a dedicated "Access Denied" page reached when my script redirects them via header("Location:") Inform a user in message in the r...

Force SSL/HTTPS with Zend Framework and mod_rewrite

I have a Zend Framework application that I want to force into HTTPS using mod_rewrite. I am pretty lost when it comes to mod_rewrite. Here is my current .htaccess file in the root of my application. RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-s RewriteCond %{...

[Zend Framework] Redirecting user back to originally desired URL after login

Example: User is not logged in User has items in their shopping cart User goes to /checkout User is redirected to the /login page User logs in successfully and should be redirected back to the /checkout page How does the login action know to redirect the user to checkout in this case? I want this to work in many different situation...

drupal redirecting api

I want to redirect this the request for "homebox/1" to "homebox/1/[uid]" if a logged in user tries to access it. I do not care about annonymous users at this point yet. This is the code I put into the top page-homebox.tpl.php: if(!is_numeric(arg(2))){ global $user; if($user->uid){ if(count($_GET) > 1){ $get = array(); foreach($_GE...

How to create a 301 redirect based on a query string within a subfolder?

I have a .htaccess file in the root of a website: /var/www/mywebsite/htdocs/.htacess and I have some files in /var/www/mywebsite/htdocs/folder/ which are currently generated by index.php?pc=1234 I want to redirect the numbers in the query string variable to static html pages within that folder. I can achieve this in the .htacess f...

Django HttpResponseRedirect reverse function in tutorial

Can someone please explain what is going on here with the Django Tutorial Part 4 Specifically, how the map function is working? I understand that URLs shouldn't be hardcoded in the view functions. return HttpResponseRedirect(reverse('mysite.polls.views.results', args=(p.id,))) ...

VB syntax for response.addheader

i'm placing a automatic redirect on my Classic ASP page (vb). i want to call the url from a variable (url2) versus hardcoding it. just need to know what the right syntax is. this is my current code: Response.AddHeader("REFRESH","10;URL=url2") ...