External rewrite engine with mysql

Using a single web hosting account to host multiple sites

External rewrite engine with mysql

Postby webbee » Sat Jun 02, 2007 5:06 am

Hi,
I am having domain name and username associated to them in mysql DB, i want to write an external rewrite mapping which will get domain name as the input and give the folder name (or the username ) which is stored in mysql database. I can create the script in PERL but do modrewrite support this, i mean everytime a domain name is called like
http://mydomain1.com is called then mysql will tell it has username abcd1 so it is pointed to http://basedomain.com/abcd1/

similarly for http://mydomain2.com to http://basedomain.com/abcd2/
and so on.
I mean this should occur everytime dynamically and not at the restart of apache and mapping be stored in mysql. Also pl, suggest will this be scalable.
Pl. reply i shall be very grateful.
Thanks,
Abhishek jain
webbee
 
Posts: 3
Joined: Sat Sep 30, 2006 10:43 am

Postby richardk » Mon Jun 04, 2007 5:04 am

can create the script in PERL but do modrewrite support this

You can use a RewriteMap (the External Rewriting Program bit) if you have access to the httpd.conf file.

Also pl, suggest will this be scalable.

Connecting to the database server each request would probably be slow. Caching the list and using a text map should be quicker.

You may also want to look at mod_vhost_alias.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 36 guests

cron