[advanced search]
Results from the most recent live auction are here.
21 members in the live chat room. Join Chat!
Register Rules & FAQ NP$ Store Active Threads Mark Forums Read
Go Back   NamePros.Com > Design and Development > Programming
User Name
Password

Old 05-11-2008, 02:40 PM   · #1
squid
Account Closed
 
squid's Avatar
 
Name: Sam Ryan
Location: Stafford
Trader Rating: (51)
Join Date: Jan 2008
Posts: 993
NP$: 15.00 (Donate)
squid is a splendid one to beholdsquid is a splendid one to beholdsquid is a splendid one to beholdsquid is a splendid one to beholdsquid is a splendid one to beholdsquid is a splendid one to beholdsquid is a splendid one to behold
Special Olympics Myanmar Relief
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.


Please register or log-in into NamePros to hide ads
squid is offline   Reply With Quote
Old 05-11-2008, 02:48 PM   · #2
-NC-
Stranger
 
-NC-'s Avatar
 
Location: in a strange land
Trader Rating: (35)
Join Date: Mar 2007
Posts: 1,304
NP$: 594.28 (Donate)
-NC- has much to be proud of-NC- has much to be proud of-NC- has much to be proud of-NC- has much to be proud of-NC- has much to be proud of-NC- has much to be proud of-NC- has much to be proud of-NC- has much to be proud of-NC- has much to be proud of-NC- has much to be proud of
Animal Cruelty Animal Rescue Ethan Allen Fund Protect Our Planet
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];
__________________
Unlimited Domain Name Hosts
Keep your names in the NameCooler
Vegas Trip
Reported NameJet to the FTC for not providing an opt out.
-NC- is online now  
  Reply With Quote
Old 05-15-2008, 02:10 AM   · #3
RickM
www.RickyMills.com
 
RickM's Avatar
 
Name: Rick Mills
Location: Herts, UK
Trader Rating: (92)
Join Date: Sep 2005
Posts: 3,549
NP$: 817.52 (Donate)
RickM has much to be proud ofRickM has much to be proud ofRickM has much to be proud ofRickM has much to be proud ofRickM has much to be proud ofRickM has much to be proud ofRickM has much to be proud ofRickM has much to be proud ofRickM has much to be proud ofRickM has much to be proud of
Cancer Survivorship Save The Children Save The Children Cancer Animal Cruelty Child Abuse Cancer Survivorship 9/11/01 :: Never Forget Animal Cruelty Child Abuse Animal Rescue Animal Cruelty Protect Our Planet Protect Our Planet Protect Our Planet
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!
__________________
WSDReg - $7.99 .MOBI | $2.89 .INFO | .ME PRE-REGISTRATIONS!


15% OFF EVERYTHING @ NOCSTER.NET! GET YOURSELF A SERVER FOR UNDER $60!
(PM me to place an order!)
RickM is offline   Reply With Quote
Old 05-15-2008, 07:43 AM   · #4
squid
Account Closed
 
squid's Avatar
 
Name: Sam Ryan
Location: Stafford
Trader Rating: (51)
Join Date: Jan 2008
Posts: 993
NP$: 15.00 (Donate)
squid is a splendid one to beholdsquid is a splendid one to beholdsquid is a splendid one to beholdsquid is a splendid one to beholdsquid is a splendid one to beholdsquid is a splendid one to beholdsquid is a splendid one to behold
Special Olympics Myanmar Relief
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
squid is offline   Reply With Quote
Old 05-15-2008, 10:49 AM   · #5
rafaelrls
NamePros Member
 
rafaelrls's Avatar
 
Location: me = new (live(in.paradise())
Trader Rating: (0)
Join Date: Jan 2008
Posts: 153
NP$: 0.00 (Donate)
rafaelrls is an unknown quantity at this point
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.
rafaelrls is offline   Reply With Quote
Reply

NamePros is a revenue sharing forum.

Thread Tools

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
Forum Jump


Site Sponsors
http://www.mobisitetrader.com/ Proof is in the Parking Build your NameBrand
Advertise your business at NamePros
All times are GMT -7. The time now is 06:40 AM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0