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

what I want to achive to be immediately moved to

when I did Redirect permanent / /cms

I got a lot of /cmscmscmscmscms etc. Any ideas?

my vhost

<VirtualHost *:443>
     DocumentRoot /home/www/sites/prod/html/development
     <Directory /home/www/sites/prod/html/development>
            AllowOverride All

     SSLEngine on
     SSLCACertificateFile    /etc/pki/tls/certs/gd_bundle.crt
     SSLCertificateFile    /etc/pki/tls/certs/prod.crt
     SSLCertificateKeyFile /etc/pki/tls/private/prod.key

     <FilesMatch "\.(cgi|shtml|phtml|php)$">
            SSLOptions +StdEnvVars

     BrowserMatch "MSIE [2-6]" \
     nokeepalive ssl-unclean-shutdown \
     downgrade-1.0 force-response-1.0
     BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown


my .htaccess

RewriteEngine On
RewriteCond %{REQUEST_URI} ^/API [NC]
RewriteRule ^(.*)$  /Application/API/api.php [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*)$  /Application/controller.php [L]

DirectoryIndex /Application/controller.php
share|improve this question
up vote 2 down vote accepted

The reason you got a redirect loop was because Redirect / /cms matches any path starting with / and appends the old path onto the new path. What you actually want is:

RedirectMatch ^\/$ /cms 

This only matches /

share|improve this answer
WORKS! :) thank you! – DmitrySemenov Oct 11 '12 at 21:28

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.