Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to direct all sub pages to a single default page.

Status
Not open for further replies.

nbateman

MIS
Jun 3, 2003
52
GB
Hi all.

We've moved our site to a new host; anyone accessing via the is fine, but anyone accessing it via the ip address is now directed to an "Information page" that tells them they need to access the site via the and not the ip address.

We've done this by using a default virtual host i.e. the ip address doen't match any of the remaining sites so defaults to the information page.

Problem is, there are hundreds of different pages that they could have book marked and therefore access directly and we don't really want to put up hundreds of identical information pages.

Is there a directive (or another method) that causes all pages within a domain to be directed to a single page? e.g.
10.0.0.1 points to /information.html
10.0.0.1/page1 also points to /information.html
10.0.0.1/dir1/page2 also points to /information.html
etc. etc.

Assistance much appreciated.
 
OK, didn't give up and stumbled upon the AliasMatch directive which does the trick - not sure how I missed it previously :-} .

I used the following within the Virtual hosts section:

AliasMatch ^/ /home/webadmin/apache/htdocs/information.html

Basically, replace any page address that starts with a "/" (everything) with the information page. Note that I needed to give the full address - /information.html didn't work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top