Ok, here is a tricky one. First person to sort us out the following code wins - pretty simple really. Our site is: http://www.photosales.co.nz At the moment, we have to manually create sub domains for photographers eg http://robyn.photosales.co.nz whcih then forwards on to http://www.photosales.co.nz/view_photog.php?photogid=163 We want a script that can either create this automatically (we can pass details like photographer ID's) based on what they want. Reading round, it looks like this is possible - I have been Googling "cpanel auto create subdomains" and the like, and have found some scripts - but nothing that will do it exactly how we want it. Thoughts?
first you have to create subdomain with " * " e.g http://*.photosales.co.nz later we can use this * to redirect to anyother users page. yess u dont have to make different domain name for users. just this * is enough. add this code into your .htaccess RewriteEngine on RewriteCond %{http_host} . RewriteCond %{http_host} !^photosales.co.nz [NC] RewriteCond %{http_host} ^([^.]+)\.photosales.co.nz [NC] RewriteRule ^(.*) http://www.photosales.co.nz/view_photog.php?photogid=%1 [R=301,L,QSA] Code (markup): u have to get [2] details [1] name [2] photo album id. so it will work like http://name.sitename.com n it will display that photoid page. it called mod rewrite. if u face any error than i can help u to sort this.
Lucas0123 has won this comp - thanks for the coding job you did on this script. Payment has been sent via PayPal.