Lexis Library and Westlaw UK both include all UK legislation currently in force, and it is probably best to start with one of these, as they will also include links to other relevant legislation and cases.
Legislation.gov.uk contains all legislation from 1988 onwards, and most pre 1988 primary legislation (Acts of Parliament, but not Statutory Instruments). In some cases only the original version is available, not a revised version. This occurs if the legislation was wholly repealed before 1991. In other cases there is only a revised version if the original (as enacted) version is not available in a web-publishable format.