logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

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.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: ReWriteRule on apache to serve a default site from
Author
velocity



Joined: 14 Apr 2010
Posts: 21

PostPosted: Mon 14 Jun '10 8:50    Post subject: ReWriteRule on apache to serve a default site from Reply with quote

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

PostPosted: Tue 15 Jun '10 15:16    Post subject: Reply with quote

what is in your rewrite log. What is in the error log?

--- edit ---

there are so many topic in the net about this

http://lmgtfy.com/?q=rewrite+to+different+domain
Back to top


Reply to topic   Topic: ReWriteRule on apache to serve a default site from View previous topic :: View next topic
Post new topic   Forum Index -> Apache