zachwlewis Posted January 26, 2007 Share Posted January 26, 2007 I would like to have a subdomain act as a variable, but I'm not sure how to do it. Basically, I want to be able to type in a URL like:[code]http://username.mypage.com[/code]And the page gets parsed as:[code]http://www.mypage.com/index.php?user=username[/code]Is this possible? Link to comment https://forums.phpfreaks.com/topic/35775-dummy-subdomains-with-php/ Share on other sites More sharing options...
The Little Guy Posted January 26, 2007 Share Posted January 26, 2007 .htaccess page possibally Link to comment https://forums.phpfreaks.com/topic/35775-dummy-subdomains-with-php/#findComment-169537 Share on other sites More sharing options...
JasonLewis Posted January 26, 2007 Share Posted January 26, 2007 just an assumption. but i dont think so. it just doesn't seem likely as subdomains are usually setup via the control panel (cPanel) which makes me wonder why it wouldnt work. maybe someone can clear it up? Link to comment https://forums.phpfreaks.com/topic/35775-dummy-subdomains-with-php/#findComment-169538 Share on other sites More sharing options...
zachwlewis Posted January 26, 2007 Author Share Posted January 26, 2007 Are you saying there is no PHP solution? Link to comment https://forums.phpfreaks.com/topic/35775-dummy-subdomains-with-php/#findComment-169727 Share on other sites More sharing options...
Jessica Posted January 26, 2007 Share Posted January 26, 2007 For something like usernames, where there will always be new people signing up, it would be way too much work to do it manually. It's mod_rewrite in htaccess. Link to comment https://forums.phpfreaks.com/topic/35775-dummy-subdomains-with-php/#findComment-169729 Share on other sites More sharing options...
zachwlewis Posted January 27, 2007 Author Share Posted January 27, 2007 Well, I read some tutorials on the use of mod_rewrite and it told me that I could do a lot with dummy directories, but it didn't really explain how to use that for subdomains. Any ideas on implementation? Link to comment https://forums.phpfreaks.com/topic/35775-dummy-subdomains-with-php/#findComment-170344 Share on other sites More sharing options...
TEENFRONT Posted January 27, 2007 Share Posted January 27, 2007 I looked into this and could never get .htaccess to work on sub domiains, so i settled for mypage.com/username as an address to give to members. .htaccess did this way just fine Link to comment https://forums.phpfreaks.com/topic/35775-dummy-subdomains-with-php/#findComment-170497 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.