0

I have small php built using slim framework. I have set it up on apache which runs on localhost:8055. Using /users/get on localhost:8055 I am able to get api results without having to use index.php/users/get.

Now, I also have IIS running on port 80 and it listens to external requests over internet. I have setup a site on iis with reverse proxy rewrite rule to localhost:8085. I am able to get result over internet via IIS reverse proxy to localhost:8055 using mydomain.com/index.php/users/get but not using mydomain.com/users/get. I think its not picking .htaccess when request goes from iis to apache.

Here is my htaccess file:

RewriteEngine On
RewriteBase /office/gcm_chat/v1/

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [QSA,L]
  • IIS should make no difference at all (unless you have a really strange htaccess file) as it is just acting as a client. If you have control over the server however, why are you using htaccess at all? just move all the configuration into the main Apache configuration files. If you need further help, please add the htaccess file to your question post. – Unbeliever Sep 30 '16 at 11:47
0

I would guess your php script is parsing the PATH_INFO which will be set to /users/get when you request mydomain.com/index.php/users/get but will not be set when you request mydomain.com/users/get. Parse the request URI instead.

It's also worth considering changing all the lines in your htaccess file to a simple FallBackResource index.php and also moving it to the main configuration file in a <Directory> block. Both these changes can be done independently.

Something like:

<Directory "c:/Path/To/office/gcm_chat/v1/">
  FallBackResource index.php
</Directory>

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.