What you are asking for is called a Captive portal :
A captive portal is a 'Landing' web page, presented by a Layer 3 brand or Layer 2 Operator and shown to users before they gain more-broad access to URL or http-based Internet services. Often used to present a Landing or Log-In page, the portal intercepts observed packets until such time as the user is authorized to launch browser sessions. After being redirected to a web page which may require authentication, payment, acceptance of EULA/acceptable use policies or other valid credentials that the host and user agree to, the user is granted conditional Internet access. Captive portals are used for a broad range of Mobile and Pedestrian Broadband services, including Cable and Commercially-provided Wi-Fi, home-hotspots and others, and can also be used to provide access to Enterprise and Residential wired networks (e.g. apartment houses, hotel rooms, business centers, etc.).
There are basically two ways to create one :
- Use an enterprise-grade router that has this capability built-in
- Use an evolved router firmware such as DD-WRT
For the second option, you should install DD-WRT in a router that is in the DD-WRT Router Database. The database also contains the installation procedure and it's best to choose a router with simple installation. This will also required setting up in your network an internal Web server for serving log-in credentials.
For more information, see the article : Create Your Own Hotspot (Using DD-WRT).