The invention discloses a Web protection method based on URL self-learning, and the method comprises the steps: executing a corresponding preset action when a requested URL triggers a white list, carrying out the URL self-learning and Web safety protection synchronously in real time, and judging whether the requested URL exists in a memory database or not; if yes, transferring the request to a Webserver for response; and if not, loading and executing the self-learning strategy, and updating the self-learning strategy to the memory database. According to the method, URL self-learning and Web protection are synchronously carried out in real time, so that the real-time performance of a learning result is ensured. Learning results are stored in a memory database, the reading speed is high, and the protection efficiency is ensured. An effective period is set for a learning result, and data is cleared for re-learning after expiration, so that the effectiveness of the learning result is ensured, and the Web security protection efficiency is improved.