Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Domain registrars' domain forwarding scripts, how do they work?
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Domain registrars' domain forwarding scripts, how do they work?

libro22libro22 Member
edited March 2012 in General

Some domain name registrars have a script where you can forward your domain name or sub-domains to other websites, if you don't have a hosting account. Which settings do you think they configure to accomplish it? I can only think of Apache's serveralias. Sometimes they also allow email forwarding, is it related to BIND settings?

I'm new on these things so any response is appreciated.

Comments

  • FranciscoFrancisco Top Host, Host Rep, Veteran

    it may very well be a simple .php script that reads from a database/caching system and simply issues a header(); :)

    Francisco

  • I just use this to redirect with Apache in .htaccess file:
    Redirect redirected_dir_or_url redirected_to_dir_or_url

  • FranciscoFrancisco Top Host, Host Rep, Veteran

    .htaccess is fine for your own usage but I can't see a host using that for millions of entries :)

    Francisco

    Thanked by 1Mon5t3r
  • Fairly easy... setup the nameservers to point to a vps with apache or lighthttpd installed with a bind configured for any domain. The php script would pull the url the user was going to (exampledomain.com) find the redirect in a database and like Fran said header("Location: newurl.com"); in all probably about 10 lines of code for as many domains as the network could handle with the right configuration.

  • AmfyAmfy Member

    Is somebody interested in a complete php script for that? Maybe I will go and code something like that at the weekend

  • i'm actually curious how do this thing work if multiple users can have their own configuration for their domains? more like of a complete running web app.

    thanks for your replies, i'm gonna think of how bind works on this

  • AmfyAmfy Member

    @libro22 this won't be an problem on php, ruby, python, etc. But I don't know how to do that only with bind without a php-script, etc.

    But my script will be able to manage multi-users :)

  • efballefball Member
    edited March 2012

    cgi script:

    cat redirect.sh 
    
    #!/bin/bash
    echo "Location: http://$1"
    echo 'Content-Type: text/html
    
    <html></html>'
    
  • BlueVMBlueVM Member
    edited March 2012

    @Amfy @libro22 - I'd be interested, but the benefit of helping you do it (besides being nice) is?

  • AmfyAmfy Member

    @BlueVM: Hm, I like to code... but, if some peoples are happy, maybe I could get some donations with that I can pay my servers... :)

    But I don't know, what do you think? Or only opensource and only making for fun?

  • debugdebug Member
    edited March 2012

    @Amfy said: Is somebody interested in a complete php script for that? Maybe I will go and code something like that at the weekend

    <?php
    header('Location: someotherurl.com');
    ?>
    
    //Just add some database query magic, caching, and checking $_SERVER['HTTP_HOST'];
    
Sign In or Register to comment.