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

Here is trouble: When i follow this link - http://znak.net.ua it rewrites to http://znak.net.ua/ru/ru/ru/ru/ru/ and i got Error 310 (net::ERR_TOO_MANY_REDIRECTS)

This happend when i start using fast-cgi insteed of mod_php Here is my .htaccess:

ErrorDocument 404 "The requested file favicon.ico was not found.

DirectoryIndex index.php


<IfModule mod_php4.c>
</IfModule>

<IfModule sapi_apache2.c>
</IfModule>

<IfModule mod_php5.c>
</IfModule>

<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresDefault A1209600
  ExpiresByType text/html A1
</IfModule>

<IfModule mod_rewrite.c>
  RewriteEngine on

RewriteRule ^(.*)$ http://znak.net.ua/ru/$1 [L,R=301]




  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} !=/favicon.ico
  RewriteRule ^(.*)$ ru/index.php?q=$1 [L,QSA]
</IfModule>
share|improve this question
    
Are you using mod_fastcgi with Apache? Also, is there a reason you're loading php4 and php5? –  nojak Nov 21 '12 at 22:03

1 Answer 1

The following line causes that behavior:

RewriteRule ^(.*)$ http://znak.net.ua/ru/$1 [L,R=301]

This says, for any request containing any characters (or none at all), redirect it to http://znak.net.ua/ru/, followed by the requested URL. If this site is, itself, http://znak.net.ua/, then that means that a request for /ru/ will be converted to ru/ (since we're in an effective <Directory> context due to .htaccess), which will in turn send us to http://znak.net.ua/ru/ru/. From there, you can easily imagine what happens on the next round when the request for /ru/ru/ comes in.

It's hard to imagine what you're trying to do with this line, so I confess that I don't really know how to "fix" it. If you can share your intention, I'm happy to offer a solution.

share|improve this answer

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.