Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: ReWriteRule on apache to serve a default site from |
|
Author |
|
velocity
Joined: 14 Apr 2010 Posts: 21
|
Posted: Mon 14 Jun '10 8:50 Post subject: ReWriteRule on apache to serve a default site from |
|
|
I have 5 websites running on a webserver.
I read Apache docs Apache serves the vhost file in alphabetical order
of name of vhost file.
I have a few subdomains on main domain
http://mydomain.com
as follows
http://site1.mydomain.com
http://site2.mydomain.com
http://site3.mydomain.com
http://site4.mydomain.com
in one of them which is served by default I want to redirect to
correct http://mydomain.com
so I added in http://site1.mydomain.com
the ReWriteRule in vhost of site1.mydomain.com as follows
ReWriteRule ^/mydomain.com$ /var/www/index.html [NC,L]
ReWriteRule ^/mydomain.com/$ /var/www/index.html [NC,L]
I checked the ReWriteLogs by
ReWriteLog "/var/log/apache2/mydomain_rewrite_log"
ReWriteLogLevel 9
could not understand much.
My problem is the ReWriteRule did not do as I wanted it to do.So I
have written some thing in correct.
Can some one help to find what is the problem in above ReWriteRule? |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
|
Back to top |
|
|
|
|
|
|