0

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>
Jaels
  • 67
  • 1
  • 11

1 Answers1

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.

BMDan
  • 7,249
  • 2
  • 23
  • 34