Victor Sigler
Victor Sigler

Reputation: 23451

Internal server error 500 with new rule in .htaccess in Prestashop

I try to put a new rule in my .htaccess to redirect when some url appears, I put the following rule in the top of the .htaccess to preserve the content in case of it's regenerated again.

RewriteRule ^webservice/?(.*)$ %{ENV:REWRITEBASE}api/test.php [QSA,L]

I created too a new /api directory under the root folder and inside it a test.php with the following stamement :

<?php
echo "Hello";

but I always get the 500 Internal Server Error.

But if I change the directory to one of the defaults of Prestashop, (e.g /webservice) and create a new php like the above it's work perfectly when I make the request.

I check all the permissions in the directory and everything its fine.

In the error log appears the following error:

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.

Thanks in advance.

Upvotes: 1

Views: 2399

Answers (1)

SaidbakR
SaidbakR

Reputation: 13544

The wrong REWRITEBASE may leads to such issues, so try to remove %{ENV:REWRITEBASE} from your rule to be:

RewriteRule ^webservice/?(.*)$ api/test.php [QSA,L]

Upvotes: 1

Related Questions