简体   繁体   中英

ASP.NET Securing a Login page for a cms

I have a website with a back end cms, this has a login page for admin people within the company. What would be the best way of stopping the login page from being exposed to the outside world (ie people who are not on the company network)?

thanks

You can use IIS to add an IP address restriction to website folders that contain internal pages only. Anything in these folders cannot be accessed via search engine spiders, or anyone that is not on your IP access list.

There are few steps to be taken.

i: restrict login page to be access by search engine by robot.txt.

ii: internally add ip restriction so only ip based on company can access login page.

For restricting crawler access, just create robots.txt file and place it on root of your project. write the following line of code within robot.txt file

User-agent: *
Disallow: /cpanel/ 

The code will restrict crawler access to /cpanel/ folder. everthing within cpanel folder will not be accessed or indexed by any search engine.

You can use single line of code to check ip address of currently browsing user.

HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];

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