Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

I have a single domain. The main application serves from a single subdomain I need a simple permenant redirect to redirect users that go to to be redirected to This is so that the users can update the bookmarks. This is temporary and I would like it to be at the apache level (directory level) and do not want to do this via htaccess files; e.g. I want to make this change in httpd.conf.

share|improve this question
up vote 2 down vote accepted

Enable mod_rewrite, if it isn't. Then, in the config for the old domain:

RewriteEngine on
RewriteRule ^.*$ [R]
share|improve this answer
He has written that he don't want it via .htaccess – Stony Mar 3 '11 at 21:05
@Stony Rewrite rules can be used in more places than just an .htaccess file. Per here: Context: server config, virtual host, directory, .htaccess – Shane Madden Mar 3 '11 at 21:14
Very important when you use this solution don't forget the return correct Statuscode 301 moved permanently or 307 Temporary Redirect. Its very important for Search Engines that he get the correct Statuscode. In This Solution in this Post [R=301,L] or [R=307,L] – Stony Mar 3 '11 at 21:24
@Stony Good point, thanks! – Shane Madden Mar 3 '11 at 21:27

You can try the apache2 module "mod_alias" with this you can make a permanent Redirect:

<VirtualHost *:80>
    Redirect permanent /
share|improve this answer

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.