Nginx rewrites login address
漂亮男人
漂亮男人 2017-05-16 17:09:26
0
1
430

The backend login address of my website is like this, www.example.com/login.php
But I want to hide the login address through Nginx and replace it with an uncommon login address, which becomes www.example .com/secretlogin.php. It also requires that access to login.php be prohibited.
My previous Nginx configuration was:

location ^~ /login.php {
    return 403;
}
location ^~ /secretlogin.php {
    include snippets/fastcgi-php.conf;
    fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    rewrite ^/secretlogin.php /login.php break;
}

But when I finally visited www.example.com/secretlogin.php, a 404 appeared.
I don’t know what the correct configuration should be.

漂亮男人
漂亮男人

reply all(1)
阿神

rewrite ^/secretlogin.php.php /login.php break;
More .php
or just like this

<?php include './login.php';?>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!