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

I'm trying to figure out how to redirect one URL to one location: to

And have all other requests from point to

So essentially all other requests will redirect to except for

I've tried setting up a Redirect rule in Apache but I'm not having any luck. I get a "The page isn't redirecting properly" message.

<VirtualHost *:80>
DocumentRoot /opt/www/
Redirect /admin
Redirect /

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Did you try (note the trailing slash):

Redirect /admin

Otherwise it would match /admin again in the Redirect, and get stuck in the loop you mentioned.

Alternatively, you could use mod_rewrite (untested):

RewriteEngine On
RewriteCond %{REQUEST_URI} !admin
RewriteRule (.*)$1 [L]

(Apache will automatically redirect to for any directory, so you would just need to refine the RewriteCond.)

share|improve this answer
Thanks Jay. Rewrite rules worked perfectly. – hfranco Sep 23 '12 at 18:02

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.