One website lots of domains

Hello,

I have a large database of vehicle data.

I currently have 5 websites that are Make Model specific and I am going to make about 30 more.

I want to keep them all separate websites with separate domains.

I literally just copy and paste the code and change the website id in the config file and it runs off the db fully.

Is there a graceful way to run all of the sites off one website?

For-instance, let's say that I have:
websiteA.com
websiteB.com
websiteC.com
websiteD.com

can all of those DNS point to mainwebsite.com and I could say in the php or htaccess that if domain name X then load website X without ever changing the domain name, so it always looks like the domain name is specific to that vehicle.

Running LAMP

Thanks,
Matt
LVL 1
movieprodwAsked:
Who is Participating?
 
Ray PaseurConnect With a Mentor Commented:
You can detect the URL used to access your web site.  The full URL is in:

$_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']

Compare this to your selection of web sites and you will be OK 99.99% of the time.
0
 
ozoConnect With a Mentor Commented:
Yes.
0
 
movieprodwAuthor Commented:
Awesome!

Any tips or clues of to do this :-)
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
movieprodwAuthor Commented:
Thank you Ray.

Can you please give me an example of the DNS I should use
0
 
Ray PaseurCommented:
I don't think any special DNS would be needed -- just point all of the registered URLs to the same web server.
0
 
movieprodwAuthor Commented:
Thank you
0
 
Ray PaseurCommented:
Thanks for the points! ~Ray
0
 
Dave BaldwinFixer of ProblemsCommented:
I had one client that had about 20 websites using the same code.  They even got a wildcard SSL cert that covered all of them.  They used Ray's method along with some htaccess code to make sure they all operated properly with the same code.  You can even put a different image or header up by detecting the URL that way.
0
All Courses

From novice to tech pro — start learning today.