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

How would I get OR

to do a redirect to


share|improve this question

migrated from Mar 16 '11 at 13:40

This question came from our site for professional and enthusiast programmers.

A little more information on your platform would be helpful. – ScottE Mar 15 '11 at 17:49
What programming language? What webserver? – Tedd Hansen Mar 15 '11 at 17:50

Assuming you are using Apache Web Server, add this to your .htaccess file:

Redirect permanent /

Then restart apache. Good luck!

share|improve this answer
What if i needed just one particular subdomain to do this? like or to redirect to – Chris Mar 15 '11 at 17:52

Assuming you are using Apache and have mod_rewrite you could add the following to your .htaccess file

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule /(.*) [R,L]

This redirects you to https only if you are not using https. If you want this to only apply to certain domains then use:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^$
RewriteRule /(.*) [R,L]
share|improve this answer

Your Answer


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