Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

VirtualHost config as below.

<VirtualHost *:80>
DocumentRoot "/opt/lampp/htdocs/site"
ErrorDocument 404 /

vhost_alias_module is not loaded.

What I want is redirecting to instead of the opposite.

share|improve this question

This is how we do this - using a "Redirect permanent" at the top of the vhost-config:

<VirtualHost *:80>
    Redirect permanent /

... rest of config

share|improve this answer
I tried this. It gave a circular redirect – powerboy May 1 '11 at 10:28
"I think there is already a redirect rule set somewhere else. But I don't where is!!" What webapp software is running on your site? E.g Drupal or WordPress? And are these running any plugins that redirect? Or do these create .htaccess files in the webroot? – Henk May 1 '11 at 10:43
Where else can we set redirect rules, other than VirtualHost config and .htaccess? – powerboy May 1 '11 at 10:45
Take a look at this answer too:… – Henk May 1 '11 at 10:50


Create a .htaccess file under the document root of the domain and insert the following code to it.

Options +FollowSymlinks
RewriteEngine On
RewriteCond %{http_host} ^ [NC]
RewriteRule ^(.*)$$1 [R=301,L] 
share|improve this answer
Same thing. It gives me a circular redirect!! – powerboy May 1 '11 at 10:32
Firefox has detected that the server is redirecting the request for this address in a way that will never complete. – powerboy May 1 '11 at 10:32
I think there is already a redirect rule set somewhere else. But I don't where is!! – powerboy May 1 '11 at 10:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.