Pergunta

This is my .htaccess contents on my local development box. It works fine. But when I try the same on my hostgator shared server it does not work.

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ perform.php?_api=$1 [QSA]

When I replace the last line with

RewriteRule ^(.*)$ http://domain.com/japi/perform.php?_api=$1 [L,QSA]

It partially works but I loose "POST" parameters sent with the request.

Anybody could shed some light on this ?

Thanks.

Foi útil?

Solução

I figured what the problem was. Although this was not an issue on the development box nor my bluehost account.

The above mention htaccess code is at a sub directory "japi" and its parent directory contains the wordpress installation. The htaccess of wordpress was causing a issue.

The

RewriteBase /

needed to be set in the sub folder as well

RewriteBase /japi

not sure why this worked on my development box or the bluehost box. Maybe the htaccess rules were not being inherited.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top