Forum Moderators: phranque
each user can view their images in
http://www.example.com/username1
http://www.example.com/username2
......
Is it possible to have URLS like
[username1.example.com...]
[username2.example.com...]
.......
and redirect them to
http://www.example.com/username1
http://www.example.com/username2
.....
Is it possible without having subdomains...?
Could u plz give me a better solution
regards
vijay
[edited by: jdMorgan at 2:37 pm (utc) on July 15, 2005]
[edit reason] Changed to example.com [/edit]
Welcome to WebmasterWorld!
Is it possible to [rewrite subdomains to subdirectories]?
Yes. We have several recent threads [google.com] here on that subject.
> Is it possible without having subdomains...?
Those "www.username.example.com" URLs you described *are* subdomains.
> Could u plz give me a better solution
"Better" is a subjective term, so I really can't give a "better" solution without knowing all your selection criteria.
The basic steps to do what you asked about are:
1) Define the subdomains (or a wildcard to include all subdomains) in your DNS zone file.
2) Define the subdomains (or a wildcard to include all subdomains) in your virtual host setup (httpd.conf file).
3) Use NameVirtualHost or mod_rewrite to 'steer' each subdomain to the appropriate subdirectory.
Some hosting accounts are already set up to do step #2, so it's worth trying this, even if you cannot change httpd.conf.
Jim
i agree with jdMorgan
you simply need to have a wildcard setup for your domain so that all subdomains reach your same directory as root directory of your main domain example.com
i mean if example.com's roo it
/home/admin/example.com/htdocs
then root of every sub-domain of example.com should also be the same
once that is done, you can simply put a small php script to parse out subdomain name from url and redirect accordingly.
Need some code?