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.
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!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
UK Deal Finder
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.
How can it be done?
Thanks for the heads-up,
Craig
UK Deal Finder
That should do it.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");
?>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 putHope that helps!Code:DirectoryIndex index.php
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
UK Deal Finder
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.
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.![]()
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
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
UK Deal Finder
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
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