Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to redirect specific page to another page. This means that requests for any other page on foo.com will function like normal, but if bar.html is requested =, it redirects to bar.com/foo.html.

This is pretty much the same problem as here Redirect specific url requests to local site except it seemed no one had a solution for what I'm asking here.

I'm also looking for an OS-wide solution.

share|improve this question
1  
After writing my answer I've noticed that you might want to perform client side redirection. Is that true? –  amotzg Apr 30 '12 at 12:41
    
CNAME Record, .htaccess file, 302 redirect, HTTP redirect, javascript and more: en.wikipedia.org/wiki/URL_redirection. If you want it on a local machine, take a look at the hosts file. –  MaQleod Apr 30 '12 at 21:32

3 Answers 3

The simplest solution that does not even require server configuration, is to include the 'meta' HTML tag in the first page's header. And set the url attribute of the second page like so:

  bar.html :
  ...
  <head>
    <meta http-equiv="Refresh" content="0;url=http://bar.com/foo.html" />
  </head>
  ...
share|improve this answer

I would not suggest using meta refresh, as it has been deprecated by the W3C for violating accessibility guidelines: https://en.wikipedia.org/wiki/Meta_refresh

Instead, you should use an HTTP 301 code, but the implementation of it is dependent on the web server you use. You can read how to use a 301 redirect in Apache here: http://www.mcanerin.com/en/articles/301-redirect-apache.asp.

share|improve this answer

What you're looking for is a proxy server that will rewrite the url. Fiddler is the only one I can think of at the moment.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.