Networks Dynamic Redirection

Discussion in 'Hardware' started by Sagegoku666@hotmai, 16 Feb 2005.

  1. Sagegoku666@hotmai

    Sagegoku666@hotmai What's a Dremel?

    Joined:
    16 Feb 2005
    Posts:
    6
    Likes Received:
    0
    I was wondering if there was any free way to take my existing domain (registered and hosted) and my existing home server (using apache) and to make a dynamic redirection page.

    I want to put a file on my webserver called aaa.jpg, then send someone to www.lexpu.com/???/aaa.jpg, and the script will replace the www.lexpu.com/???/ part with my IP.

    Currently i have to send them a link to my IP, or make a redirection page for everything i want to host at my server than i want to send to people.
    I've already searched around dynDNS.org, but the service they offer costs money or I have to use their domain.
    Basically, I want to put file x on my server (http:/124.124.124.142 i dunno my IP) and link to lexpu.com/???/x. I dont know the ??? part- im not very knowlegable in Javascript.

    Thanks in advance to any help
     
  2. Bruno_me

    Bruno_me Fake-ad‎min

    Joined:
    30 Mar 2003
    Posts:
    1,136
    Likes Received:
    1
    it's possible with mod_rewrite, but I don't know how to do it

    check out apache's manual on mod_rewrite
     
  3. Sagegoku666@hotmai

    Sagegoku666@hotmai What's a Dremel?

    Joined:
    16 Feb 2005
    Posts:
    6
    Likes Received:
    0
  4. Bruno_me

    Bruno_me Fake-ad‎min

    Joined:
    30 Mar 2003
    Posts:
    1,136
    Likes Received:
    1
    that part of apache is used to do exactly what you described, so using that modules, you can do what you wanted to do
     
  5. trigger

    trigger Procrastinator

    Joined:
    22 Mar 2004
    Posts:
    1,098
    Likes Received:
    31
    I think he's saying the server hosting lexpu.com is not his, so he can't do apache stuff on it. I guess you could use a redirector meta tag like this:

    Code:
      <meta http-equiv="REFRESH" content="5; URL=http://123.123.123.123/aa.htm">
    edit: Ah, but that wont work with the .jpg files though of course...
     
  6. Sagegoku666@hotmai

    Sagegoku666@hotmai What's a Dremel?

    Joined:
    16 Feb 2005
    Posts:
    6
    Likes Received:
    0
    Exactly: Lexpu.com isnt my apache server. Its some other hosting thing that i pay for. My IP address isn't in a DNS. The Meta Tag solution would work, except it doesn't work for all files and I'd have to make an html page with that for each page i want to redirect to. Isn't there some way where its smart enough to parse the URL and redirect using a dynamicly changeable (Like it loads my IP from a source file so I only have to change one thing if my IP changes) Address?
    Lets say theres a file called ip.txt that contains my IP
    I want it to be able to take something like www.lexpu.com/??/aa.htm, say ooh, thats in the /??/ directory. Ok, lets redirect to http://[the IP in ip.txt]/aa.htm
    Or, www.lexpu.com/??/newfolder/aa.htm would go to http://[the IP in ip.txt]/newfolder/aa.htm

    aa.htm is just an example. It could be asdasd.jpg, or w/e. The whole point is i don't have to upload to lexpu.com and I don't have to type my IP each time I want to give someone something (www.lexpu.com/??/filename.extension is alot easier that http://255.255.255.0:81/filename.extension since that 255.255.255.0 could be anything)
     
  7. RTT

    RTT #parp

    Joined:
    12 Mar 2001
    Posts:
    14,120
    Likes Received:
    74
  8. Sagegoku666@hotmai

    Sagegoku666@hotmai What's a Dremel?

    Joined:
    16 Feb 2005
    Posts:
    6
    Likes Received:
    0
    I have content on lexpu. can i make it so it takes lexpu.com/??/aa.htm and makes it [ip here]aa.htm? I still want my other stuff on lexpu.com (such as the lexpu.com/programs/ directory)
     
  9. Atomic

    Atomic Gerwaff

    Joined:
    6 May 2002
    Posts:
    9,646
    Likes Received:
    94
    So you only want say

    lexpu.com/move/aa.htm -> #IP#/aa.htm

    Your best bet is prob a php script id guess...
     
  10. RTT

    RTT #parp

    Joined:
    12 Mar 2001
    Posts:
    14,120
    Likes Received:
    74
    yep, just put the .htaccess file in the /??/ directory..., such as lexpu.com/redirect/ so anything @ lexpu.com/redirect/[ANYTHING HERE] is redirected :)

    Or you could just alter the htaccess file to read:

    Code:
    RewriteEngine On
    ReWriterule ^redirect/(.*) http://your-ip-here/$1
    
     
  11. Sagegoku666@hotmai

    Sagegoku666@hotmai What's a Dremel?

    Joined:
    16 Feb 2005
    Posts:
    6
    Likes Received:
    0
    k! works great. thanks so much
     
  12. RTT

    RTT #parp

    Joined:
    12 Mar 2001
    Posts:
    14,120
    Likes Received:
    74
    No problem :thumb:
     
Tags:

Share This Page