Welcome to Welcome to DNF.com™ - Domain Sales, Domain Forum, Domain Appraisals, Domain Registrars

If you are new to domains and looking to buy, sell and learn about domains then you have come to the right place. DNForum is the largest domain name community on the internet and continues to grow every day. There are over 105,000 domainers on DNForum doing everything from buying domains, selling domains, learning about domains and discussing domains. Take a minute and Register.

Register Today on DNForum IT'S FREE!

Results 1 to 11 of 11
  1. #1
    Wistow.net
    wistow's Avatar
    Join Date
    Jun 2004
    Location
    Barnsley, UK
    Posts
    909
    Country

    UK
    DNF$
    1,784
    Bank
    0
    Total DNF$
    1,784
    Donate  

    .htaccess + Domain Parking

    Hi

    Does anyone know what to add into a .htaccess file so that parked domains can be pointed to certain files

    e.g. http://www.domain1.com is a domain parked by a client. This domain needs to point to http://www.maindomain/parking/domain1.com

    It needs to be a dynamic .htaccess so that it can handle multiple redirects without having to add them to the .htaccess file.

    Thanks in advance for any guidance,

    Craig

  2. #2
    dvdrip's Avatar
    Join Date
    Jul 2002
    Location
    Athens Greece
    Posts
    2,713
    DNF$
    14,482
    Bank
    0
    Total DNF$
    14,482
    Donate  

    Re: .htaccess + Domain Parking

    Do you mean you want a single .htaccess for a single Hosting account handdling multiple domains parked there? This can't be done by .htaccess alone.
    www.bluepixel.gr I like .info!
    Now accepting .gr domain registrations from any foreign company or individual. Contact me for details.

  3. #3
    Wistow.net
    wistow's Avatar
    Join Date
    Jun 2004
    Location
    Barnsley, UK
    Posts
    909
    Country

    UK
    DNF$
    1,784
    Bank
    0
    Total DNF$
    1,784
    Donate  

    Re: .htaccess + Domain Parking

    How can it be done?

    Thanks for the heads-up,

    Craig

  4. #4
    Web Guru

    Join Date
    Apr 2003
    Location
    Connecticut
    Posts
    208
    DNF$
    2,104
    Bank
    0
    Total DNF$
    2,104
    Donate  

    Re: .htaccess + Domain Parking

    PHP Code:
    <?php
        
    # parking domain to prepend
        
    $parked 'http://www.maindomain/parking/';
        
        
    # domain -- removing the www. subdomain just incase
        
    $host $parked . @ereg_replace('www.','',$_SERVER['HTTP_HOST']);
        
        
    # redirecting
        
    header("Location: $host");
    ?>
    That should do it. Just save it as 'index.php' and you're good to go.

    If for some reason it doesn't pick that up as the index, in your .htaccess put
    Code:
    DirectoryIndex index.php
    Hope that helps!

  5. #5
    Wistow.net
    wistow's Avatar
    Join Date
    Jun 2004
    Location
    Barnsley, UK
    Posts
    909
    Country

    UK
    DNF$
    1,784
    Bank
    0
    Total DNF$
    1,784
    Donate  

    Re: .htaccess + Domain Parking

    That won't work, but thanks for trying
    It would pickup and re-direct and visitors to www.mainsite.com, and there's also the problem of parking the domains DNS to point to my server. I would need a vps or dedicated server to use domain parking.

    Craig

  6. #6
    Exclusive Lifetime Member
    theparrot's Avatar
    Join Date
    Mar 2004
    Posts
    641
    DNF$
    36,544
    Bank
    0
    Total DNF$
    36,544
    Donate  

    Re: .htaccess + Domain Parking

    I use a VPS along with some custom nameserver software (uses much less memory then bind). Works very well. PM me if you are interested.

  7. #7
    007's Avatar
    Join Date
    Jul 2004
    Location
    nurv.com
    Posts
    1,417
    DNF$
    20,348
    Bank
    0
    Total DNF$
    20,348
    Donate  

    Re: .htaccess + Domain Parking

    Play around with some of the stuff here:

    http://www.web-developer.com/forum/s...ad.php?t=56872

    Or do a search for [R=301,L], that's how I found that above link. You are looking to do a 301 redirect.

    I have something similar running for multiple domain redirects, etc. That should set you in the right direction at least.
    ► Does your company need the NURV ® touch?
    Professional logo animation services.


  8. #8
    The Bishop
    namestrands's Avatar
    Join Date
    Jan 2005
    Location
    Langley, VA
    Posts
    4,053
    DNF$
    3,312
    Bank
    0
    Total DNF$
    3,312
    Donate  

    Re: .htaccess + Domain Parking

    you dont want to do a 301 redirect as this is permanent redirect and your site will loose all PR and eventualy will get removed from the search engines.

    What you need to do is read up on
    RewriteCond %{HTTP_REFERER} !^$
    and then pass the variable domain onto the Rewrite Rule

    Its going to be a complex task. Unless you opt for your own nameservers.
    Enterprise Communications and Social Media in Uist

  9. #9
    Wistow.net
    wistow's Avatar
    Join Date
    Jun 2004
    Location
    Barnsley, UK
    Posts
    909
    Country

    UK
    DNF$
    1,784
    Bank
    0
    Total DNF$
    1,784
    Donate  

    Re: .htaccess + Domain Parking

    Hi namestrands

    If I opt to use my own nameservers (which isn't a problem) what would be the next step? If i add RewriteCond %{HTTP_REFERER} !^$ http://parkeddomain.com to .htaccess how would I get it to show the parked page? Or would it be automatic?

    Kind Regards,

    Craig

  10. #10
    The Bishop
    namestrands's Avatar
    Join Date
    Jan 2005
    Location
    Langley, VA
    Posts
    4,053
    DNF$
    3,312
    Bank
    0
    Total DNF$
    3,312
    Donate  

    Re: .htaccess + Domain Parking

    If you opt for your own nameservers then you can use WildCard DNS to automate it all.

    This is what most other parking programs use. You can then use the .htaccess to capture all the subdomain and 404 traffic generated..

    Unfortunetly you have a bit of reading to do.

    There is another Solution. You could infact use CNAME records and run it all from your own home broadband connection on a Windows server Machine or *Nix Box. (very simple) and you dont even need to have a fixed IP address you can use DDNS.

    I ran 4000 domains on my little spare HP windows 2003 Server computer and on a 2mb ADSL connection. Worked out really well actually.
    Enterprise Communications and Social Media in Uist

  11. #11
    The Bishop
    namestrands's Avatar
    Join Date
    Jan 2005
    Location
    Langley, VA
    Posts
    4,053
    DNF$
    3,312
    Bank
    0
    Total DNF$
    3,312
    Donate  

    Re: .htaccess + Domain Parking

    ok this is an absolute hunch and may need some editing, this concept just came to me
    RewriteCond %{HTTP_REFERER} !^$
    RewriteRule ^/(.*) http://www.example.com/parking/$1 [L,R]
    Give that a try..

    In theory that if you forward www.domainone.com to www.domaintwo.com the result would be www.domaintwo.com/parking/www.domainone.com

    you could then further expand to strip the host part (www) so it would be www.domaintwo.com/parking/domainone.com

    You will need to do some work on it though in order to filter out subdomains etc
    Enterprise Communications and Social Media in Uist

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Domain name forum recommended by Domaining.com