1
votes

I am trying to set up a REST Server (Restler) in php, it works fine in MAMP

But as soon as I put it on my live server with Cent OS 6.2, it gives me a 500 error. What things would cause this ?

Here is the htaccess:

DirectoryIndex index.php
<IfModule mod_rewrite.c>
   RewriteEngine On
   RewriteRule ^$ index.php [QSA,L]
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
<IfModule mod_php5.c>
   php_flag display_errors On
</IfModule>

RewriteRule ^(.*)$ index.php [QSA,L]

^-- this line seems to be the issue.

I see this in my logs:

[Thu Jun 20 09:13:52 2013] [error] [client 5.64.252.223] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

[Thu Jun 20 09:13:52 2013] [debug] core.c(3072): [client 5.64.252.223] r->uri = /lookbunnyfind.com/go/index.php

[Thu Jun 20 09:13:52 2013] [debug] core.c(3078): [client 5.64.252.223] redirected from r->uri = /lookbunnyfind.com/go/index.php

[Thu Jun 20 09:13:52 2013] [debug] core.c(3078): [client 5.64.252.223] redirected from r->uri = /lookbunnyfind.com/go/index.php

[Thu Jun 20 09:13:52 2013] [debug] core.c(3078): [client 5.64.252.223] redirected from r->uri = /lookbunnyfind.com/go/index.php

[Thu Jun 20 09:13:52 2013] [debug] core.c(3078): [client 5.64.252.223] redirected from r->uri = /lookbunnyfind.com/go/index.php

[Thu Jun 20 09:13:52 2013] [debug] core.c(3078): [client 5.64.252.223] redirected from r->uri = /lookbunnyfind.com/go/index.php

[Thu Jun 20 09:13:52 2013] [debug] core.c(3078): [client 5.64.252.223] redirected from r->uri = /lookbunnyfind.com/go/index.php

[Thu Jun 20 09:13:52 2013] [debug] core.c(3078): [client 5.64.252.223] redirected from r->uri = /lookbunnyfind.com/go/index.php

[Thu Jun 20 09:13:52 2013] [debug] core.c(3078): [client 5.64.252.223] redirected from r->uri = /lookbunnyfind.com/go/index.php

[Thu Jun 20 09:13:52 2013] [debug] core.c(3078): [client 5.64.252.223] redirected from r->uri = /lookbunnyfind.com/go/index.php

[Thu Jun 20 09:13:52 2013] [debug] core.c(3078): [client 5.64.252.223] redirected from r->uri = /hi

[Thu Jun 20 09:13:52 2013] [debug] mod_deflate.c(602): [client 5.64.252.223] Zlib: Compressed 628 to 389 : URL /lookbunnyfind.com/go/index.php

1
You're redirecting index page to index page means infinite redirection causing 500 error.Rikesh
the problem is an infinite redirection, do you have an index.php file in your go folder?Amine Hajyoussef
There could be two problems. 1( You are redirecting to index page, which is infinite 2( you do not have mod_rewrite enabled in your apache configuration.Kees Sonnema
Yes I have an index.php in my go folder, where should I put the index.php file ?James Campbell

1 Answers

1
votes

Try changing your .htaccess code to this:

DirectoryIndex index.php

<IfModule mod_rewrite.c>
   Options +FollowSymLinks -MultiViews
   # Turn mod_rewrite on
   RewriteEngine On
   RewriteBase /go/

   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-l
   RewriteRule . index.php [L]
</IfModule>

<IfModule mod_php5.c>
   php_flag display_errors On
</IfModule