If you are in Domaining business, you probably have some domains that you want to sell. Often times, if you really want to sale a name, you want to place a “domain for sale” page for the domain. It’s not hard to create a simple domain for sale html page, but you’d have to do it for every domain you have for sale, which gets overwhelming when you have 10s or 100s of such domains.

Here is a little tutorial of how you can mix in some php code and have only one php page for all of your domains for sale, yet when you go to the page, it’ll have domain specific content.

As you know, I am a web developer and I hate reparative tasks, even if I only have to copy paste. I always look for ways to automate tasks or make it dynamic when it comes to domaining. Dynamic in programming simply means that it should automatically adjust itself to fit the needs. In this case, it should adjust the code so shows something different based on the domain you’re at.

In my case, my domain for sale page is really simple, it just has “{Domain Name} Domain Is For Sale!” and some contact info. Here are a couple of examples: VideoCopyright.com, eCardboard.com

Here is how you do this:

  1. Replace the above {Domain Name} with this code, so you end up with:

<? echo strtoupper($_SERVER['HTTP_HOST']);?> Domain Is For Sale!

  1. Rename your file to something with .php, if it’s the home page, rename it to: index.php
  2. After you upload to your hosting, make sure you delete the old index.html page.
  3. Assuming your hosting supports php, that’s it you should now see the domain name when you visit the page.
  4. Now all you have to do with all of your domains for sale, simply point them to the same directory.  This is done a little differently based on which hosting company you’re with. With godaddy, you can change folder of the domain so all of your domains point to the same folder. With others, you may simply have to create “domain pointer”. Check with your hosting provider to see how you can point multiple domains to a single destination. This is not to be confused with forwarding, when you go to the domain url, you should not be redirected to some other domain.

 

 

Update:

just to be a little more clear,  replace all the text in your html page where you typed in your domain with that code.

for example:

Before:

VideoCopyright.com domain name is for sale!

After:

<? echo strtoupper($_SERVER['HTTP_HOST']);?> domain name is for sale!

 

do this for all the places you have typed in your domain.