redirect

.htaccess Problem

I'm having trouble with redirecting urls using the .htaccess file. This is how my htaccess file looks like: Redirect 301 /file-name/example.php http://www.mysite.com/file-name/example-001.php Redirect 301 /section-name/example.php http://www.my-site.com/section-name/example-002.php RewriteEngine on RewriteCond %{HTTP_HOST} !^www.mysite...

How to redirect to the requested URI after authentication using Zend_Auth?

Hi everyone, I am using a simple Zend_Auth setup to authenticate users for one of my applications, using a check in the preDispatch() method in a controller plugin. When anonymous users navigate to /users/view/id/6 for example, they should be redirected to the above URI after authentication. What is the best way to do this? I'd pre...

How do I redirect to an ftp:// url with Spring Webflow?

I'm trying to use Spring WebFlow to redirect to a computed url to an ftp server, but in the ExternalRedirect code are the following lines: } else if (location.startsWith("http://") || location.startsWith("https://")) { sendRedirect(location, request, response); } else { sendServletRelativeRedirect(location, request, response); } Is ...

IIS: Redirect ALL requests to one page?

For my IIS website, I'd like to redirect ALL requests to ONE page. The purpose of this is that I want to do some maintenance on the database (take it off-line) that all my web applications use. I have about 50 web apps running under this website, so I'd like to avoid visiting each of them to change something. I'm thinking I could make a...

AWK: redirecting script output from script to another file with dynamic name

Hi all, I know I can redirect awk's print output to another file from within a script, like this: awk '{print $0 >> "anotherfile" }' 2procfile (I know that's dummy example, but it's just an example...) But what I need is to redirect output to another file, which has a dynamic name like this awk -v MYVAR"somedinamicdata" '{print $0 ...

Is it best to use HTTP REFERER for redirects or use some other method?

Currently, we're storing the user's HTTP_REFERER so we can redirect the user back to the previous page they were browsing before they logged in. Http Referer comes from the client and can be spoofed or blank. Is there a more secure/reliable method to deliver this handy user redirect? ...

IIS Page Redirecting for no apparent reason

I'm the IIS admin, not the developer on this site, so the code is opaque to me. I'm stumped, though, for where to look. Using Windows Forms Authentication, the user is directed to a login page. If their password is expired, they are directed to ChgExpiredPwd.aspx. On our dev and test servers this works. On our production server, the us...

PHP open another webpage with POST data

I'm new to PHP and I'm trying to do something that may be bad practise and may well be impossible. I'm basically just hacking something together to test my knowledge and see what PHP can do. I have one webpage with a form that collects data. That is submited to a PHP script that does a bunch of processing - but doesn't actually display ...

HTML Link opening a page that Redirect to a Quicktime .MOV file displays garbage characters in IE when Target is _blank

Hi, I have a .NET page that does a Response.Redirect to a Quicktime .mov file. When I create a link to this .NET page, if the link opens in the same window (i.e. no Target defined on the anchor tag), all is good and IE displays the Quicktime movie just fine. However if I set the Target of the link to "_blank" which opens a new window, I...

Grails forwarding and/or redirection with parameters

Is it possible to do page forwarding in Grails? I searched but no luck. If possible, how do I pass parameters in the forwarding method? If not, how would I do it using redirection? I've found something like this for redirection so far: <% response.setStatus(301); response.setHeader( "Location", "http://wodaklab.org/resource/paramName" )...

Redirect 'myapp.com' to 'www.myapp.com' in rails without using htaccess?

Using Morph Labs' Appspace to deploy a site means no automated way to redirect 'myapp.com' to 'www.myapp.com' (and no access to .htacess). Is there an in-rails way to do this? Would I need a plugin like subdomain-fu? More specifically, I'm trying to do something like: 'myapp.com' => 'www.myapp.com' 'myapp.com/session/new' => 'www.mya...

getting redirect loop for admin_only decorator

I've made this decorator, which results in an infinite redirect loop. The problem is this: args[0].redirect(users.create_login_url(args[0].request.path)) It appears to be a perfectly valid URL. So why wouldn't it properly redirect? def admin_only(handler, *args): def redirect_to_login(*args, **kwargs): return args[0].r...

Rails RESTful controller and rendering after custom action.

How can I render after executing an action in a restful controller instead of redirecting. I have a controller with standard actions, and I added a special action that adds data to the resource in question, via a form on the #show page (Think comments on a post). I am validating the input from the form and want to re-render the show act...

"Unknown web method" error after Server.Transfer

I use System.Web.Services.WebMethodAttribute to make a public static method of an ASP.NET page callable from a client-side script: test.aspx.cs [System.Web.Services.WebMethod] public static string GetResult() { return "result"; } test.aspx <asp:ScriptManager ID="sm" runat="server" EnablePageMethods="true" /> <script type="text/...

301 redirect

How do i redirect a url to domain . eg. http://www.mydomain.com/index.php=HairThing --> http://www.mydomain.com How do i redirect a non-www to www WITHOUT a slash at end ? eg http://mydomain.com ---> http://www.mydomain.com ...

IIS6 - How do I redirect users to another site for every page with a few exceptions?

I have a website setup in IIS 6, let's say it's called http://www.this.com. I have setup a redirection for this website to http://www.that.com which maintains the directory structure and query parameters as follows: http://www.that.com$S$Q - using the option "The exact URL entered above" This works great, whenever someone requests, fo...

How to do 301 redirects in asp.net from old Apache mod_rewrite style urls when moving a site from php to asp.net?

Hi I have an existing site in php running on Apache using the mod_rewrite plug-in. In other words, I currently have urls like www.example.com/section/subsection/ which Google and others have indexed. However, the site needs a major upgrade, and I would like to move it to asp.net. I only have the option of using a shared hosting solutio...

How do you restrict access to certain paths using Lighttpd?

I would like to restrict access to my /admin URL to internal IP addresses only. Anyone on the open Internet should not be able to login to my web site. Since I'm using Lighttpd my first thought was to use mod_rewrite to redirect any outside request for the /admin URL back to my home page, but I don't know much about Lighty and the docs...

Tracking redirects and cookies with Python

Hi, I would like to do be able to follow and track redirects and the cookies that are set by the different webpages with Python (a bit like the tamper plugin for Firefox). So if website1 redirects to website2 which then redirects to website3, I would like to follow that and also see what cookies each website sets. I have been looking ...

Dispatch-like CGI Approach

Opinions: I want to disallow direct invocation of certain scripts, that have functionality accessible from a menu, via Web at the OS level (linux). I was hoping to call a authorize.pl script that checks the session validity, checks user privileges etc. Then it will redirect to the target script. Does this get around permissions? ...