Results from the most recent live auction are here .
23 members in the live chat room. Join Chat !
05-11-2008, 02:40 PM
· #1 Account Closed
Name: Sam Ryan
Location: Stafford
Join Date: Jan 2008
Posts: 993
NP$: 15.00 (
Donate )
Mod_rewrite, something.site.com
Hey
You know how sites like Newgrounds work, with
http://USERNAME.newgrounds.com or
http://VARIABLE.site.com and then it takes that word, how's it done?
Presumably it's done with $_GET['variable']; but how would i tell the script that the GET is that string?
Is it with mod_rewrite? A link would be helpful, or even a code snippet explaining, ty.
User goes to
http://LOLHI.website.com then page then echo's "LOLHI", because LOLHI is the $variable.
05-11-2008, 02:48 PM
· #2 Stranger
Location: in a strange land
Join Date: Mar 2007
Posts: 1,304
NP$: 594.28 (
Donate )
1. you'll need wildcard dns setup, unless you plan on setting up each sub domain yourself.
2. to get the domain name, you'll need $_SERVER['SERVER_NAME']
3. to get the first part of the domain, you can convert it to an array:
PHP Code:
$domainparts = explode ( '.' , $_SERVER [ 'SERVER_NAME' ]);
echo $domainparts [ 0 ];
05-15-2008, 02:10 AM
· #3 www.RickyMills.com
Name: Rick Mills
Location: Herts, UK
Join Date: Sep 2005
Posts: 3,549
NP$: 1217.52 (
Donate )
Sounds like your doing a free subdomain hosting kind of thing. I made several of these scripts, e107deluxe.com is one of my creations....its fairly easy to do:
Open your httpd.conf file and where you have the record for your domain all the way down the bottom of the file, find thid:
Quote: ServerAlias yourdomain.com
and change it to this:
Quote: ServerAlias *.yourdomain.com
Save and exit, then restart apache.
Now use the code posted by -NC- to finish it off!
05-15-2008, 07:43 AM
· #4 Account Closed
Name: Sam Ryan
Location: Stafford
Join Date: Jan 2008
Posts: 993
NP$: 15.00 (
Donate )
Yeah, i should have posted saying i managed it, but I managed it just after NC posted, using his post + some google knowledge
It was for
http://somebody.lovescitricsquid.info and a few other similar sites i want to make ^__^
Thanks anyway <3
05-15-2008, 10:49 AM
· #5 NamePros Member
Location: me = new (live(in.paradise())
Join Date: Jan 2008
Originally Posted by RickM Sounds like your doing a free subdomain hosting kind of thing. I made several of these scripts, e107deluxe.com is one of my creations....its fairly easy to do:
Open your httpd.conf file and where you have the record for your domain all the way down the bottom of the file, find thid:
Quote: ServerAlias yourdomain.com
and change it to this:
Quote: ServerAlias *.yourdomain.com
Save and exit, then restart apache.
Now use the code posted by -NC- to finish it off!
Very good post Rick, it helped me a lot too.
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off