Internet users use the web to search for information they need. Every user has some particular interests and preferences when he/she searches information on the web. It is challenging to trace the exact interests of a user by a system to provide the information he/she wants. Personalization is a popular technique in information retrieval to present information based on an individual user’s needs. The main challenges of effective personalization are to model the users and identify the users’ context for accessing information. In this paper, we propose a framework to model the user details and context for personalized web search. We construct an ontological user profile describing the users preferences based on the users context. Finally, we use a semantic analysis of the log files approach for the initial construction of the ontological users profile and learn the profile over time. Web information can be accessed based on the ontological user profiles, re-ranking the searched results considering the users’ context. Experiments show that our ontological approach to modeling users and context enables us to tailor the web search results for users based on users’ interests and preferences.