redirect

How do I detect web surfing habits and redirect the browser?

Howdy, I have a simple basic program in mind to keep my kids off certain websites for prolonged periods of time. Basically, I would like to run a little background process that would have something like this : if (user is on website for > 20 minutes every 24 hours ) { browser redirect user to specified website } I realise...

.htaccess - redirect requests from a certain IP only

I believe someone is scraping images from my site. So what I want to do is, based on their specific IP address, serve up some kind of holding image instead of the actual image. How do I achieve this using .htaccess? ...

PHP session variables lost on header redirect using PHP_SELF in the form action

I have a multi-step form, let's say for the sake of ease it's 2 steps. First step I want to select a radio button and based on that radio button selection it takes me to a certain page, but I also want that selection stored in a session. I have 2 pages: page1.php session_start(); if(isset($_POST['post'])) { if (($_POST['country'] == ...

Check conditions on each page request

I have multi-tenant ASP.NET MVC application which utilizes subdomains to determine the current tenant. Whether or not the domain is valid is determined via database table lookup. Where would be the best place to have a function that checks if the domain is in the database?If the subdomain is not in the database, it should redirect to th...

How to use Facebook OAuth 2.0 authentication like Zynga and other use it?

I want to display the "Request for Permission" box directly when the user enters http://apps.facebook.com/myfancyapp. The Facebook Authentication documentation is pretty clear on how the URL have to look like https://graph.facebook.com/oauth/authorize?client_id=[APPID]&redirect_uri=http://www.myfancyapp.com/&scope=user_photos,us...

AuthorizeAttribute with custom redirect

I want to use the standard AuthorizeAttribute (i.e. not inherit it) but with a custom redirect. Is that possible? where should I check for 401 and redirect? I've tried to add <customErrors mode="On" > <error statusCode="401" redirect="/Errors/NotAuthorized/" /> </customErrors> but it didn't work. ...

Fiddler: Can I redirect outgoing traffic from foreign console app to Fiddler instance (localhost:8888)?

I am looking for a way to forward traffic from an application which goes to the web over port 443 to an instance of Fiddler running on my computer. Fiddler does not see this traffic while a packet trace application verified that the traffic is going out. The application is foreign and I am not able to modify how it requests and it is n...

jquery: POST data + redirect page not working as expected

I'm trying to submit some data using POST method and redirect the page. But whenever I click on the submit button, the jquery does not load properly on the new page. I was able to reduce my problem to the following code. For example, If I press submit, a new page gets loaded. But Submit button doesn't give any response, and no alert box...

What is wrong with this apache url htaccess rewrite rule?

I've got this: RewriteEngine On RewriteRule ^/redir?url=(.*)$ http://blah.$1 When I use this and go to the url that looks like: http://www.mydomain.com/redir?url=www.otherdomain.com It says the file isn't found on my server. I.E. no redirect. What I want it to do in the above example would be to redirect to: http://blah.www.othe...

Redirect in around filter after action has been yielded

I'm using an around filter which on certain occasions should redirect user to other path AFTER an action has been yielded (either ending with render or redirect). Writing redirect_to in around filter after yield statement results in double render error. Trying to "reconfigure" response object (by setting body to nil and location header ...

form POST + direct. Not posting

ok so here is my HTML <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd"&gt; <!-- XHTML ADVANCED --> <html xmlns="http://www.w3.org/1999/xhtml"&gt; <head> <title>Find Hotels</title> <style type="text/css"> a:visted {color:#e27023; ...

mod_rewrite 301 redirect from old url to new codeigniter

Hi I have updated my website to now use the codeigniter framework my new urls are like the following example.com/index.php/home/page/page-title The old urls are example.com/index.php?option=com_content&view=article&id=249 Ideally I want to do a redirect for all links formatted in the old way to the new links but there are a lot of pag...

Django: how to redirect to mailto

I have a Django admin action called "Email selected members". Check some members and click the Go button and the user's mail program is opened. The emails of the selected members have been pre-entered. This works by a Django HttpResponseRedirect(uri) with the uri being "mailto:email1,email2.. where the addresses email1, email2 ... were...

Redirecting for mobile web browsers

Hi, Is there a way to redirect for mobile web pages; and what is the best layout for mobile browsers? I currently have my pages set to relative sizing via percentages. ...

CakePHP log in redirect to requested URL

When a user clicks a link that requires a log in, we currently redirect them to the log-in page ,but we lose the intended URL. What is the best way to account for that URL and redirect the user to the requested page once logged in? We're using the latest stable version of Cake. Thanks. --Edit-- Its configured like this $this->Auth->...

ASP.net redirect user on condition

Given my registration page: <asp:CompleteWizardStep ID="CompleteWizardStep1" runat="server"> <ContentTemplate> <span class="defHead">Thank You!</span><br /><br /> You are now registered on our system.<br /><br /> </ContentTemplate> </asp:...

ASP.net, retreive domain name /path

I need to fetch the domain name and path from the request to provide the following return values: domain1.com/default.aspx returns domain1.com/default.aspx domain1.com/ returns domain1.com/ domain1.com returns domain1.com At the moment every URL fetch function I try seems to return doma...

windows.location.href and base tag in Opera 10.63

I have a page (for examle, localhost/catalog/) with select element on it. <select name="type" id="typeSel"> <option value="2" selected="selected" >Type 1</option> <option value="1" >Type 2</option> </select> Also there is base tag in the page: <base href="http://localhost/" /> I want to change page url when user click on l...

Redirect RuntimeError to log instead of console in wxPython?

How do I redirect RuntimeError to log instead of the console? In the code below, the 'Hello' is printed to console, which is redirected to the wx.TextCtrl. The RuntimeError raised OnClose is printed to the terminal however. How do I redirect the RuntimeError to see same log as the 'Hello'? import sys import wx class RedirectText: ...

How to do htaccess redirect based on cookie value

I have failed at Google and I could not find the answer searching here. Sorry, I'm a newb at htaccess and it has really odd syntax and is so hard to learn! You can see what I'm trying to do here... RewriteEngine on RewriteCond %{HTTP_COOKIE} ^.*user_id=(\d+).*$ [NC] RewriteRule .* http://localhost/mysite/cache/$1 [R=301,L] RewriteRule ...