Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

what I want to achive

prod.com to be immediately moved to prod.com/cms

when I did Redirect permanent / /cms

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

my vhost

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

     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
     </FilesMatch>

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

</VirtualHost>

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.