Without doubt, the best website for historical knowledge (and any knowledge) is Wikipedia. Wikipedia has strict rules on what can be posted and historical knowledge has to be properly referenced. Be careful though, ultimately Wikipedia does involve a lot of opinion.
Here are some other websites to assist you with gaining more historical knowledge or where to locate it:
Worldcat: An online library platform. It will tell you your nearest library that holds the book you have searched for.
Internet Archive: An online archive of websites, videos, documents and scanned books covering lots of different material.
Project Gutenburg: Appropriately named after the inventor of the printing press, Project Gutenburg is a database with public domain books available in many different formats including Kindle.
Jstor: Holds a comprehensive collection of journal articles - a common website used by universities and I spent lots of time on here during my under-graduate degree, a paid subscription is required though.
Wiley Online Library: Hosts over 4 million articles from over 1500 journals and 11,500 online books. Paid subscription required.
British Library ETHOS: You can download over 500,000 PhD theses here - I even found Dr Longson's. You only need to register (it's free) and then you can download.
The British Library Catalogue: The online catalogue on here is huge and easily dwarfs many other online resources but the website is often difficult to navigate. Well worth a look though. Remember to look at the free exhibition room on the Places to visit page.
Directory of Open Access Journals: Free access to thousands of online journals. The European History search alone brought up over 20,000 entries. It has lots of other subject areas as well.
Gallica: Bibliotheque Nationale de France: Is one of the major digital libraries available for free via the Internet. It provides access to any type of document: printed documents (books, press and magazines) in image and text mode, manuscripts, sound and iconographic documents, maps and plans.
Ancient History:
Perseus Library: Holds lots of classical texts online (Plato, Cicero, Homer etc). You can read the English translation or see the Latin or Greek. A must for anyone interested in Ancient Greek and Roman history.
The Open Richly Annotated Cuneiform Corpus: Has lots of links to great sites that give really helpful overviews of Middle Eastern civilisations.
Medieval History:
Medievalists.Net: An excellent website for anyone interested in anything Medieval. It has free access to a range of sources, articles, books, podcasts - endless resources.
Foundation for Medieval Genealogy: With thorough referencing, this site provides as many aristocratic and royal families as possible. A subscription is required but you never know, you could be like Danny Dyer and related to royalty?
The Online Medieval Sources Bibliography: Collection of primary sources. Has links to WorldCat library if the document/book is not on the website.
Early Modern History:
The Encyclopedia of Diderot & d'Alembert: Designed to be accessible to teachers and students and has many English translations of Diderot & d'Alembert's Encyclopédie. Read more about it here.
Eighteenth Century Collections Online: Every significant English language and foreign language title printed in Great Britain during the Eighteenth century including important works from the Americas.
Modern History:
German Federal Archives: A collection of approximately 11 million pictures, aerial photographs and posters from modern German history. The first is from the 1860s. Available in English.
CAIN: A wide range of resources from Northern Ireland's political history from 1968 onward.
The Office of the Historian: State Department: Provides de-classified documents on the USA's foreign policy from Abraham Lincoln to JFK.
Seventeen Moments in Soviet History: Part primary documents and part essay, this website is designed to be accessible to those wanting to understand the complexities of Soviet history.
Parallel History Project: Lots of resources from the Cold War and especially the Eastern Bloc.
Wilson Digital Archive: A treasure trove with plenty of sources on the Modern world history.
Marxists.org: Archive for anything socialist/communist related including works from notable individuals.
Fordham Sourcebook: Takes you to different websites on specific areas of history.
Encyclopedia Iranica: A comprehensive research tool dedicated to the study of civilisations in the Middle East, Caucuses, Central Asia and Indian subcontinent.
Chinese Text Project: An online digital library that makes pre-modern Chinese texts available. Some are available in English.
Euro Docs; Online resource for European history. Arranged by country and era.
German History in Documents and Images: Primary sources available in English and German on the history of Germany from 1500 onward.
Index Islamicus: Considered the best place for anything related to the Middle East and Islamic world. Subscription required.
Irish History: Via reddit, from here you can access up to date links to primary and secondary resources on Irish history. Use the sidebar on the right hand side to find what you are looking for.
National Portrait Gallery: Here you can search and view the gallery's collections of 185,000 portraits. Alternatively, you can see them in person, see the Places to visit page.
Women's history:
Havard's Working Women Collection: A free collection of primary sources on American working women 1800-1930.
Cornell's Home Economics Archive: A free collection for anyone interested in social history or the domestication of women from 1850-1950.
International Institute of Social History: Women's History Index: Offers an overview of American and European publications.
Maps:
Map History/History of Cartography: Who doesn't love a good map? Although this website is quite old, it has lots of historical maps from all over the world from different eras.
Native Land: This site provides a decent approximation of the traditional territories of indigenous peoples and nations. You can look up the impact of treaties and reservations.