redirection

C++ iptables redirection forming separate packets

I have all traffic from port 50 redirected to 5050 using iptables -t nat -A POSTROUTING -p udp --dport 50 -j REDIRECT --to-port 5050 I listen using a RAW Socket on 5050, and I see IP packets from 0.0.0.0:50 to 0.0.0.0:5050. The original destination address is obviously not present, since this seems to be a separate redirection packet...

Opening an iframe source in a new tab if it tries to redirect the user

It's a known fact that a lot of websites use javascript codes to prevent from browsing them using iframes. I would like then my iframe to behave like this: if the site doesn't have such a code and isn't trying to redirect the user, its content should be shown in the iframe. But if it's trying to redirect, it should be opened in a new tab...

Facebook like usage of #! in url for content loaded through ajax

I am using ajax to load content for my site. When I dynamically load a page http//www.example.com/a/b/c I change my current page's url to http//www.example.com/xyz/#!/a/b/c by setting it through javascript using window.location Now what I want to do is that when somebody enters a url http//www.example.com/xyz/#!/a/b/c in the browser, he...

Javascript Confirmation Box on Exit

Hi there, I got strange problem with setting up a confirmation box on user exit. Here's the code: function closeIt() { var message = "Click 'Cancel' right now!"; evt=(typeof evt == 'undefined') ? window.event:evt; evt ? evt.returnValue = message:null; return message; } window.onbeforeunload = closeIt; ...

How to do a redirect without the original referrer showing?

I need to do redirect my site visitors to a third party site, without the original referrer showing as the urls disclose private information. Is there a way to instruct a browser redirection without a referrer being sent to the destination site? E.g. using javascript? Thanks ...

ASP.NET MVC redirect after logon to the page a user came from

Let's take as an example a standard default ASP.NET MVC project created by Visual Studio. Being on ../Home/About page I click Log On link and get to the ../Account/LogOn page. After logging in I'm being redirected to the Home page, not to the Home/About page from which I get to the LogOn page. Why is that? Though, in the AccountControl...

.htaccess redirect doens't work correctly

Hi, I'm using a .htaccess to get all documents from an old site to the new one. The old site doesn't support PHP or mod_rewrite. I tried the following code: Redirect 301 / http://www.new.com/archive/ I requested " http://www.new.com/archive/index.html" Which resulted into http://www.new.com/archive/old.com/olddir/&&&/&am...

Redirect domain.com/something to domain.com/?page=something with .htaccess

How can I redirect domain.com/something to domain.com/?foo=something using .htaccess? I have a code that does a similar thing: RewriteRule ^go/([a-z]+) http://domain.com/?foo=$1 [NC,R] This will do, in e.g. domain.com/go/something redirect to domain.com/?foo=something It's probably easy to do but I can't make it work.. anyo...

redirect to an external url on form submit

i have a form which on submit should redirect to an external URL to perform some action with my form data, as well as remain on the home page after successful submission. i used redirection, but this will make my second option possible, but not my first one. Please help.. ...

.htaccess redirection

Hello, My domain is http://www.somename.com. I want if an user type {path to website}/index.php, it should redirect him to {site name} basically I want to remove that index.php from the URL. and one more thing, it should work both for {www.sitename} {sitename} any idea is greatly appreciable. Thanks in advance. ...

301 redirect .htaccess

Hi, I got a question. How do I 301 redirect, for exemple: a subdirectory /Blog/ to /blog/ with .htaccess? Thanks ...

[Android] Binding EditTextPreference to a given preference file (getSharedPreferences)

Hi, two activities here, A and B. A is main, B is PreferenceActivity with two EditTextPreference. I want to be able to access the preferences generated by B from activity A, and for that I need of course (I guess) getSharedPreferences on A. But in order to do that I need to supply the preference file for the activity that generated it. ...