Solved

atomatic subdomain access

Posted on 2006-11-26
4
166 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 33

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATE…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

740 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