Abstract-Web page classification has wide applications. Due to various types of web pages and vast amounts of network traffic, it is difficult to classify web pages by deeply inspecting the content of each packet. This paper presents a learning-based classification method according to TCP/IP header features. First, we propose an approach to select features and improve the Relief algorithm, which can pick features with robustness. Then we raise a labeling strategy to assign each feature with a label when training the classifier. Last, we put forward a learning-based classification method which takes labels and multi-layer semantics into consideration. The experiment results show that the proposed strategy can improve the processing speed and the accuracy of classification.