1

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.

jmasterx
  • 565

3 Answers3

1

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.

yutsi
  • 103
  • 1
  • 9
1

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.

Ariel
  • 984
0

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>
  ...
amotzg
  • 979