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

I want to redirect a to What is the simplest way to do this?

I tried editing httpd.conf and to the redirect command. It didn't worked. Also I tried creating a file on sites-enabled with rewrite commands. Also, it didn't work out.

Sample config on sites-enabled:

RewriteEngine On
RewriteRule /.* [R]
share|improve this question
Do you want an internal redirect (browser URL remains /) or do you want a browser redirect (browser URL becomes /url) ? – Rob Olmos Dec 2 '10 at 5:36
I am not familiar with the terms but I think I want a browser redirect. So for example, whenever a user access, it will be redirected to – Jonar Dec 2 '10 at 11:49

This is bad practice, and search engines like Google will give you a lower score for not serving content on the base url if its linked to, however...

Your redirects are recursive in both situations, you need to make it so that it wont redirect once its at the correct url, e.g.

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/url
RewriteRule ^.* /url [L,R]

I think in the case of your redirect, you shouldn't need to redirect everything to that url, just the root url.

RewriteEngine On
RewriteRule ^/$ /url [L,R]
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.