H
H
HAbRAhabp2015-10-28 21:43:20
PHP
HAbRAhabp, 2015-10-28 21:43:20

How to reconfigure nginx in Apache?

Hello, I have this nginx config

location /recovery.pb {
        try_files $uri $uri/ /libs/recovery_pass.php;
    }

and such a php script
<?php
    require("../init.php");
    echo basename(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH));

When I go to /recovery.pb/token1/ token1 is not displayed, the reason below
is Apache processes php, and nginx works as a frontend (gives static). Make Apache change the $_SERVER['REQUEST_URI'] of the old script to the new one. For some reason, I can't do it. Such .htaccess (lies at the root):
<IfModule mod_rewrite.c>
         RewriteEngine On 
         RewriteBase /  
        
        RewriteCond  %{REQUEST_URI}  ^/libs/recovery_pass.php.*
        RewriteRule  ^/$   /recovery.pb  [L]
        
        </IfModule>

Help me configure .htaccess correctly
PS I'm making a self-written script, and I want password recovery to look like this: /recovery.pb/token/

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question