Solved

atomatic subdomain access

Posted on 2006-11-26
4
160 Views
Last Modified: 2010-03-04
I have set up ftp support for student . Student can access it using this url : http://student.domain.com/username

how to make it's available to access student page using this url : http://username.domain.com for easy address.

thanks in advance
0
Comment
Question by:hendri2
  • 2
4 Comments
 
LVL 3

Expert Comment

by:www-i-p-mu
ID: 18027510
Hi hendri2,

could you please explain your issue more in details.

Regards

www-i-p-mu
0
 

Author Comment

by:hendri2
ID: 18028146
thanks for respon,

I set virtual host for our student  :

<VirtualHost 192.168.1.2>
ServerAdmin webmaster@ourdomain.com
DocumentRoot /data3/student

<Directory  /data3/student>
        DirectoryIndex index.php index.html index.htm default.htm
        Options Indexes
    </Directory>

ServerName student.ourdomain.com

</VirtualHost>

Then add record in DNS to resolv 192.168.1.2 as student.ourdomain.com

each student can access their web using this address :

http://student.ourdomain.com/username

I want every student can access their address in this format :

http://username.student.ourdomain.com

how to do that ?

0
 
LVL 32

Accepted Solution

by:
shalomc earned 500 total points
ID: 18069141
Try this

RewriteEngine on
RewriteCond   %{HTTP_HOST}                 ^[^.]+\.student\.ourdomain\.com$
RewriteRule   ^(.+)                        %{HTTP_HOST}$1          [C]
RewriteRule   ^students\.([^.]+)\.ourdomain\.com(.*)/$1$2



http://httpd.apache.org/docs/2.0/misc/rewriteguide.html

0
 

Author Comment

by:hendri2
ID: 18081909
good solution, thx you very much
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now