简体   繁体   中英

How to protect purely html page from unauthorized access?

I have admin page which is purely in html , After Login as admin It redirect to admin page. Url of admin page is http://URL/index.html . But this page is also accessible if we just type URL. So any body can access this page if he know the url of this page. So I want to protect this html page from unauthorized access. Here php file, html file are separate. To access that page there will be login id and password. After only matching login id and password, the required page should be load.

<head>
    <title>Service for home - Next Generation of Service Provider - Admin               
</head>

<body>
      Welcome admin..
</body>

You can also do it with .htaccess. And for protection from search engines you can use robot.txt

try http basic auth with nginx

    location /index.html {
            auth_basic "auth";
            auth_basic_user_file /etc/nginx/.htpasswd;
    }

related tutorial

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM