Hi there, I'll try to be as descriptive and clear as possible, even though I'm Dutch.. I would like my urls to be like: 'http://variable1.mydomain.com/variable2'. These urls I would like to rewrite using htaccess (and wildcard dns) to one page, located at http://www.mydomain.com/mypage.php. Two different pages I would like even better, depending on the absence (or not) of the variable2. Variable 1 is the artist, and variable 2 is the title of the artists song. If variable 2 isn't there, then the visitor will have an url like http://variable1.mydomain.com and see the artists page with all the songs the artist has written. If the song title is there, the visitor will be directed to the specific song page. A rewrite rule that redirects the visitor to two different pages would be the best, but one page would be ok as well, since I can always strip the url using php. I hope you're still with me ... What I've got so far is this: RewriteCond %{HTTP_HOST} !^www\.mydomain\.com?$ RewriteCond %{HTTP_HOST} ^([^.]+)\.mydomain\.com?$ RewriteRule ^$ /mypage.php?id=%1 [L] This works 'perfect', I get to see ther artists page with it's songs..But now I want to add a rule that makes it possible to put the second variable in the url, so I can use urls like http://variable1.mydomain.com/variable2/. Here it stops for me.. I've tried (almost) everything, some solutions to other problems on this forum but I can't get it working for me... I hope you all understand what I mean, want, and even more, that somebody is able to help me... Thanks in advance! Thijs
That's the part we don't know how to do. A LOT of us have wanted to do this ever since we all discovered that SPAMoogle gave a lot of bonus points to sites that SPAMed Google by having all the pages be sub-domains.
I'm not sure if I understand your reply the way you meant it to be understood, are you being cynical or are you serious when telling that you (guys) don't now how to use wildcard dns.. ? (Sorry for this, it's the language barrier between us ;-)) But I don't think the wildcard dns is the problem here, I just can't find the right rewrite rules for my .htaccess, although wildcard dns (the subdomains) is ofcourse part of the whole thing.. Thanks for your answer!
So far I havn't seen any one post how to do the wildcard trick. For example, some where in this thread, we all started talking about trying to figure out how to do it and none of us figured it out.