1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Redirects to home server?

Discussion in 'HTML, Graphics & Programming' started by Borris, 28 Mar 2006.

  1. Borris

    Caporegime

    Joined: 25 Oct 2002

    Posts: 30,410

    What's the most basic (and safest) way to redirect a page to a server on my home network?

    Specifically, I have TivoWeb set up at home (so I can change channels on the TV from anywhere in the world - how lazy is that? It's wap enabled too :)), but can't always remember my IP address - I just want to type in http://tivo.mysite.com and forward there automatically.
     
  2. Andyt_uk

    Wise Guy

    Joined: 14 Dec 2003

    Posts: 2,147

    Location: Malvern

    something like www.no-ip.com would be what you need. You just need to signup and then you just need your external IP to place in there. That'll be so you can access from outside. Although why would you want to change TV channels when your not at home? :p

    Internally you can probably just put an entry into your hosts file. Something along the lines of

    IPaddress Tivo

    Then putting tivo into the address bar should take you to it.

    Hopefully :)
     
  3. Borris

    Caporegime

    Joined: 25 Oct 2002

    Posts: 30,410

    Ooops - I was being a bit ambiguous, in that I have a static home IP (so no need for www.no-ip.com), but can't always remember it.

    What I do have is a hosted domain, on which I want to place a page that automatically redirects to the tivo hosted page.

    Using the hosts method is not an option, as I am on clients' machines.
     
  4. robmiller

    Capodecina

    Joined: 26 Dec 2003

    Posts: 16,522

    Location: London

    DynDNS offers support for static IPs - it basically just redirects a subdomain to your static IP.
     
  5. Borris

    Caporegime

    Joined: 25 Oct 2002

    Posts: 30,410

    The client site that I'm on has it blocked (so it's safe to assume other clients will too).

    I though it would be a simple case of a bit of code in index.htm (or index.php etc.)?
     
  6. Beansprout

    Man of Honour

    Joined: 31 Jan 2004

    Posts: 16,316

    Location: Plymouth

    If you have control of your domain's DNS then add an A record for something like tivo.[domain] and give it your home IP :)
     
  7. Borris

    Caporegime

    Joined: 25 Oct 2002

    Posts: 30,410

    I doubt I do (1and1 are the hosts) - And I wouldn't know what an A record is either :)
     
  8. robmiller

    Capodecina

    Joined: 26 Dec 2003

    Posts: 16,522

    Location: London

    Wait, you already have the domain hosted? Presuming it's running Apache, stick this in a file called .htaccess in your document root:

    Code:
    RewriteEngine On
    RewriteRule ^.*$ http://127.0.0.1/$1 [QSA]
    
    Where 127.0.0.1 is your external IP, naturlich.
     
  9. Borris

    Caporegime

    Joined: 25 Oct 2002

    Posts: 30,410

    Grazie mille.

    Obviously, I've now found that I can change the DNS settings for subdomains.

    I'll stick with .htaccess though - At least it gives me an extra layer of protection too :)
     
  10. Borris

    Caporegime

    Joined: 25 Oct 2002

    Posts: 30,410

    Seeing as you're on a roll (and if you're not, this may coax you into one), how do I do the following:

    I have awstats installed (on a remote host), and to access it, I must type: http://awstats.notarealdomain.com/awstats.pl?config=someconfig.

    Can I use the RewriteRule bit to add the awstats.pl?config=someconfig bit?
     
  11. crazymoose

    Associate

    Joined: 23 Nov 2005

    Posts: 32

    AS you said you could just use an index.html file,

    If you know the static IP already then lets assume its something like this

    http://xxx.xxx.xxx.xxx:port/tivo/

    You could create a index.html file with does a HTTP refresh like so:

    <html>
    <head>
    <meta http-equiv="refresh" content="0;url=http://xxx.xxx.xxx.xxx:port/tivo/">
    </head>
    <body>
    Redirecting...
    </body>

    I am assuming from your posts that you have a host somewhere to upload to index.html file to, so create a new folder called tivo and upload the index.html then all you would need to do is goto your domain.com/tivo and it should redirect to your static IP.
     
  12. robmiller

    Capodecina

    Joined: 26 Dec 2003

    Posts: 16,522

    Location: London

    If you can access the actual awstats directory, where awstats.pl is, then yep:

    Code:
    RewriteEngine On
    RewriteRule ^/$ awstats.pl?config=someconfig
    
    should do the trick.
     
  13. Borris

    Caporegime

    Joined: 25 Oct 2002

    Posts: 30,410

    Luvverly - Thanks guys.