I have created a members area on a website where members can create a personal web page for themselves. The page winds up being at: mywebsite.com/user So far so good (all working nicely).. However, I want that user to be able to acces the page with a subdomain, because it looks a lot nicer. ie: user.mywebsite.com What is the easiest way I can go about this?
Don't hold your breath for a solution. I've been searching Google for: virtual subdomains create subdomain mod rewrite htaccess subdomains wildcard subdomains craete subdomain for user folder subdomain tutorial virtual subdomain tutorial (and about 5 dozen other variations).. ..and I've looked several pages deep under each search, and all I can find is either answers that don't really answer (ie: "yeah, just use virtual subdomains"), or answers that are similar but not really what I want (or are the oppositie of what I want). Apparently, if you want a server to display the contents of: website.com/user under: user.website.com You have to find the wizard of oz or something. As far as I can see, no one on the Internet knows how to do it. Or, there's some secret society that have employed tens of thousands of people to erase the knowledge from the internet, in case Darth Vader find out or something.
I have already seen that page and used that script, and it works, but it still doesn't help me. I need: jack.mywebsite.com to display the contents of: mywebsite.com/jack
hi MrLen, there are several methods that you can take to create sub-domains for your website. METHOD 1 (ASSUMING THAT YOU DON'T HAVE ACCESS TO THE httpd.conf FILE) Open the .htaccess file Insert the code listed below #Grab the subdomain from the domain RewriteCond %{HTTP_HOST} ^([^.]+).hm2k.org$ #Make sure the subdomain is not www or example RewriteCond %{1} !^(www|example)$ #Check if the directory actually exists before we go there RewriteCond /home/hm2k/public_html/%1 -d #This stops it from looping RewriteCond %{REQUEST_FILENAME} !^/home/hm2k/public_html/ #Finally, this is the actual rewrite RewriteRule (.*) /home/hm2k/public_html/%1/$1 [Last] Code (markup): save the .htaccess file METHOD 2 (ASSUMING YOU CAN ACCESS CPanel) if you have cpanel then you can ask your users to send a request and you will crate the sub-domain manually via cpanel. i hope this comes in useful to you and others who need a similar solution.
this is simple . On your webhost add a subdomain and the folder (treated as a completely new website on your host) instead of giving it a domain name like www.newsite.com you just give it the domain of user.www.mywebsite.com This could be the home page for that site which they can log into from there. or have user.mywebsite.com/user1029 But obviously you're only wanting the user.mywebsite.com A fix in 5 seconds at your webhosts TOOLS and domains settings. They should have something already set up for SUBDOMAINs (I know places like Lunarpages.com has this standard in their tools and Ive nested 1over 100 sites inside of a top level before. you should even be able to set up emails etc for your subdomain by using their tools. A redirect as others are telling you is useless ..they're only giving you options to have the ADDRESS BAR display changed ..but it doesnt literally create a directory/site for users At lunar pages when you create a subdomain you can give it its own domain name , example www.completely_new_site.com OR if youre nopt purchasing a new domain name, you just give it a subdomain name off of your already existing site. (exactly what you're asking) products.mysite.com , stuff.mysite.com If your host doesnt allow subdomains, they suck. on lunarpages you can create as many as you want .