WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-14-2004, 04:53 PM
WebProWorld New Member
 

Join Date: Jul 2003
Location: UK
Posts: 12
kengeddes RepRank 0
Default 500 websites - 1 template?

Apologies up front if this is posted in the wrong section.

Is it possible to design a single website which has around 30 different pages. Let's call it www.johndoe.com.

Then in the background somewhere have a database of say 500 different batches of names, specific content, contact details, maybe even a logo.

Then using the initial site actually dynamically create what are effectively 500 different websites using a URL such as www.johndoe.com/1 ; www.johndoe.com/2 ; www.johndoe.com/3 and etc.

This would mean that when the user typed in the URL the website would effectively pick up the data specific to the url and insert it automatically?

This would not just relate to the title but to specific content within the 30 or so pages.

Any thoughts on whether this would be possible, how it would be done and if you know of any examples would be greatly appreciated.
__________________
Ken Geddes
ken.geddes@energylinx.co.uk
Reply With Quote
  #2 (permalink)  
Old 05-14-2004, 05:02 PM
WebProWorld Member
 

Join Date: Nov 2003
Location: Bedford, Va.
Posts: 72
wmabear54 RepRank 0
Default

Hi kengeddes

You could use subdomains and call them say www.1.johndoe.com, www.2.johndoe.com, www.3.johndoe.com and then use something like php and mysql.

Mike
Reply With Quote
  #3 (permalink)  
Old 05-14-2004, 07:53 PM
calypso_webmaster's Avatar
WebProWorld Pro
 

Join Date: May 2004
Location: New Brunswick, Canada
Posts: 128
calypso_webmaster RepRank 0
Default

it could be done..would require a lot of time and coding..but you could basicly have though where you are goign to have the url like www.johndoe.com/2 you are sendign it to a diff dir..so you would have to have the page script all in the dir too..so would be better to just write each page out for each diff site..if your goign to go through all that work..

Although I know with my portfolio I only use one page and it contains all the data for my resume, clients, education, indea, etc...

so it can be down..but instead of putting the /2 at the end I would put like ?site=1 and then on th epage have like the script

<?php

if (site == 2){
echo " your site "
}

that should work for you...

thanks,
__________________
Micheal Geldart
CalypsoWebDesign.com
www.calypsowebdesign.com
Three Months Free Hosting! Find Out How?
Feel Free To Review:CalypsoWebDesign.com
Reply With Quote
  #4 (permalink)  
Old 05-17-2004, 01:10 PM
WebProWorld Pro
 

Join Date: May 2004
Location: Austin, TX
Posts: 199
steve0 RepRank 0
Default

Depending on what the site is/can be written in..
In php for example, use
$r=getenv("PATH_INFO"); or
$r=getenv("REQUEST_URI");
$var_array = explode("/",$r);
to pull apart the URL and assign it to a variable, say $foo

Then get any part of the url which is actually your variable to identify the correct information in your database..

SELECT * FROM tablename WHERE template_style='$foo';

Hope this helps..
__________________
Hardcore Programming Solutions and Coffee Drinker
Reply With Quote
  #5 (permalink)  
Old 05-17-2004, 01:44 PM
WebProWorld Veteran
 

Join Date: Apr 2004
Posts: 453
HardCoded RepRank 0
Default

Yes, that's works particularly well with a mod_rewrite setup like this:
Code:
RewriteEngine on
RewriteCond %{REQUEST_URI} !/static/.*
RewriteRule .* index.php
Basically every request goes to your script, except things you don't want, like requests for images and js files.

Then you can take apart the request as per the suggestion above. I usually go:
Code:
$url_vars = explode('/',$_SERVER['REQUEST_URI']);
// more code...like regex. Also you need to
//redirect to /foo/ if user requests /foo because
//apache can't do this for you any more.
$sql = "SELECT stuff FROM tbl WHERE cat = '{$url_vars[1]}'";
and so on.

Then make all your links relative to doc root, like this:
href="/cat/subcat/some_product.htm"

Works sweet, and is of minimal difficulty. As an added bonus, you'll never get a 404 again :)
Reply With Quote
  #6 (permalink)  
Old 05-19-2004, 03:43 PM
WebProWorld New Member
 

Join Date: May 2004
Location: US
Posts: 1
asiemer RepRank 0
Default I have done it in ColdFusion

If you would have a look at www.bearep.com you will see the master site. This site contains any categories of products, etc. Then you can go to www.paintballrewards.com or www.safetyshow.com and you will see content pertaining only to each specific URL based on admin settings for that URL. Each customer can have as many URLs in their account as they like and each URL can have as many of the parent categories as they like. This allows (in this case) a site to have as many URLs as they like that pertain to certain realms of products which in the end helps to do two things (for us). For one...having your keywords in the URL is the best way to shoot to the top of a search engine. Also when promoting your warez at events...it is nice to be able to go to a paintballshow and pass out cards with the URL "paintballshow.com", etc. Lots of things that can be done with this type of system...and it is all based on the same back end which makes for very easy administration!

Let me know if you need more info.
__________________
-Andrew Siemer
asiemer@hotmail.com
www.drewsweb.com
Reply With Quote
  #7 (permalink)  
Old 06-21-2004, 10:12 PM
WebProWorld Member
 

Join Date: Apr 2004
Location: Florida
Posts: 99
ECommerceConversions RepRank 0
Default

You could do that easily in .NET without creating a page. Just put the info like "Content", "Page Title", "URL" etc into different collumns of SQL Server. Then, when a page is requested, check the "URL", lookup in SQL, and then do a Server.Transfer to a template page and populate the template lage with different fields from the Table. Let me know if you need more info. The benefit to this method is only the template file has to exist, and the user is none the wiser
__________________
Joe

<a href="http://www.ecommerceconversions.com">
Custom Web Design and E-Commerce Solutions - ECommerceConversions</a>

Ozone Generators where you can buy an ozone generator or ozone machine
Reply With Quote
  #8 (permalink)  
Old 06-22-2004, 01:08 AM
WebProWorld Veteran
 

Join Date: Apr 2004
Posts: 453
HardCoded RepRank 0
Default

Or instead of having to pay for stuff, just do the same thing in PHP and MySQL. ;)

Yes, it can be done. I once did 4000 video store websites, each with their own database of 50,000 movies (they all started off with the same batch of movies) and I used their 10-digit phone number as the identifier. Part of a project proposal I was involved in.
Reply With Quote
  #9 (permalink)  
Old 06-24-2004, 04:13 PM
WebProWorld New Member
 

Join Date: Jun 2004
Location: UK
Posts: 6
Brian_uk RepRank 0
Default Another way...

I have a site that does somthing similar (www.searchBath.com). Its a single site with one sub directory to hold images.

If a visitor to the site requests say www.searchbath.com/appydaze then it generates a "404" error. But within IIS I redirected http:404 errors to a web page that searches an SQL table, finds appydaze and displays the appropriate files.

Its not a fast site - its not meant to be - its my code playground!
Reply With Quote
  #10 (permalink)  
Old 06-24-2004, 04:14 PM
WebProWorld New Member
 

Join Date: Jun 2004
Location: UK
Posts: 6
Brian_uk RepRank 0
Default Another way...

I have a site that does somthing similar (www.searchBath.com). Its a single site with one sub directory to hold images.

If a visitor to the site requests say www.searchbath.com/appydaze then it generates a "404" error. But within IIS I redirected http:404 errors to a web page that searches an SQL table, finds appydaze and displays the appropriate files.

Its not a fast site - its not meant to be - its my code playground!
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Tags: , ,



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Search Engine Optimization by vBSEO 3.2.0