Welcome Guest, Not a member yet? Register   Sign In
Falling in a redirect loop
#1

[eluser]Dsyfa[/eluser]
Hi,

I recently uploaded an .htacess file to remove the index.php from my URL's. Now I get the following error:
Quote:Redirect Loop

Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

This is my .htacess file:
Code:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
    # If we don't have mod_rewrite installed, all 404's
    # can be sent to index.php, and everything works as normal.
    # Submitted by: ElliotHaughin

    ErrorDocument 404 /index.php
</IfModule>

Let me know if you need any other info.

Thanks
#2

[eluser]Clooner[/eluser]
In which directory did you have the .htaccess file? Try removing: RewriteBase /
#3

[eluser]Zeeshan Rasool[/eluser]
Yar ! i think you have to check this code. Save it wirh .htaccess but remove 'index.php' from your config.php file

Options +FollowSymLinks
Options -Indexes
DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|images|css|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]

Hope you will get it.
...............JaMzEe
#4

[eluser]Unknown[/eluser]
Hello, guys.
I'm having the same issue...

Edit: Never mind, I just started from scratch and it's working now. I messed up somewhere before.

I've added zishan code (slightly modified) to my .htaccess and still the same redirect loop...
Code:
Options         +FollowSymLinks
Options         -Indexes
DirectoryIndex  index.php
RewriteEngine   On
RewriteCond     $1                    !^(index\.php|ci|img|css|js|robots\.txt|favicon\.ico)
RewriteCond     %{REQUEST_FILENAME}   !-f
RewriteCond     %{REQUEST_FILENAME}   !-d
RewriteRule     ^(.*)$                index.php?/controller/$1   [L,QSA]

Now, the particulars of my case...
  • I have an empty 'index_page',
  • is a sub-domain,
  • 'base_url' is set to 'http://sub.domain.tld/',
  • its content is in a folder with the same name (i.e., public_html/sub/)
  • I have a rule such as
    Code:
    RedirectMatch permanent  ^/sub/(.*)$  http://sub.domain.tld/$1
    in the .htaccess of the root www dir (i.e., public_html)
  • I've played around with 'uri_protocol' but I haven't found any difference,
  • I have set the default controller (to 'controller'),
  • the application is actually in a 'ci' folder inside the sub-domain folder (i.e. public_html/sub/ic/),
  • all redirects are done to the same sub-domain root address (e.g., 'http://sub.domain.tld/')
    —I've just noticed this happens even when I give the full address,
    e.g., 'http://sub.domain.tld/index.php/controller/function'

I think that's it. Any suggestions?

P.S. Do somebody knows how can I use UL/OL list and KBD/CODE/SAMP tags in this forum?
#5

[eluser]Unknown[/eluser]
Note for everyone that has encountered the problem that redirects in Firefox 5 were working, but not in IE8 and chrome (and maybe others).
I solved this by adding this to my .htacces, I had also removed index.php from the url. Hopes this help you.

Code:
Options         +FollowSymLinks
Options         -Indexes




Theme © iAndrew 2016 - Forum software by © MyBB