Lumio Posted February 12, 2007 Share Posted February 12, 2007 Hello! I'm writing a community where users can create theire own websites. the websites get saved in ./web/[username]/ Every user has also his own userpage. So if you get to [username].mydomain.com/ you come to his userpage. BUT: He also can set up his userpage to redirect his own website. So if you get to [username].mydomain.com/ you actually get to mydomain.com/web/[username]/ But I want that the adressbar shows [username].mydomain.com/ How can I do that? Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 12, 2007 Share Posted February 12, 2007 That's what mod_rewrite is for - why do you want to do it without it? I believe in DNS you can do *.domain.com - you could direct that to a specific page, then use PHP to get the whole URL to get the user's name. Quote Link to comment Share on other sites More sharing options...
Balmung-San Posted February 12, 2007 Share Posted February 12, 2007 That's what mod_rewrite is for - why do you want to do it without it? It could be that their webhost doesn't allow it. I know WebHostingBuzz doesn't allow for mod_rewrite (or quite a few modules for that matter). Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 12, 2007 Share Posted February 12, 2007 So pony up the $5 monthly to get a decent host. Quote Link to comment Share on other sites More sharing options...
Balmung-San Posted February 12, 2007 Share Posted February 12, 2007 So pony up the $5 monthly to get a decent host. That's about the cost of WebHostingBuzz. I haven't found anybody else who's quite so cheap that I like (except this one company in the UK, but they didn't want to do internation sales). Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 12, 2007 Share Posted February 12, 2007 GoDaddy is 3.99 and they allow it. Quote Link to comment Share on other sites More sharing options...
Lumio Posted February 12, 2007 Author Share Posted February 12, 2007 I'm sorry you missunderstood me .... my fault I already did that... so if is say lumio.mydomain.com it goes to my userpage. But when I want to set up the option to redirect to my personal website... I don't know how to do that. I also told that problem in another board. They told me to write a .htaccess with all redirects. So if one user sets it up to redirect to his website, the script should write it into the .htaccess. But I'm not happy about that. I'm looking for another solve. Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 12, 2007 Share Posted February 12, 2007 on the current page, use header('Location: http://othersite.com'); Quote Link to comment Share on other sites More sharing options...
Lumio Posted February 12, 2007 Author Share Posted February 12, 2007 I know that command... but if I use that the adress bar shows me the real url. I want to handle it like DNS does. Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 12, 2007 Share Posted February 12, 2007 I don't think you're going to be able to without mod_rewrite, unless you only have one page - then you could include it. If you have many pages, your links would have to point to the other domain, and users will see it. Quote Link to comment Share on other sites More sharing options...
Lumio Posted February 12, 2007 Author Share Posted February 12, 2007 hmm... ok... I think I have to do that really with mod_rewrite. But thanks for trying to help me Quote Link to comment Share on other sites More sharing options...
Lumio Posted February 12, 2007 Author Share Posted February 12, 2007 yep... I think I found a way to do that as easy as you can. I though about a function that gives me the content-type of a file. So if someone requests the url lumio.mydomain.com/myfile.html the file get back to index.php index.php reads the whole url and reads the file /lumio/myfile.html And mime_content_type() is giving me the mime-type of myfile.html Yeah Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.