Virtual Hosting Hack (Older Clients)

 
Post new topic   Reply to topic    Aprelium Forum Index -> Tutorials
View previous topic :: View next topic  
Author Message
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Wed Oct 19, 2005 7:14 am    Post subject: Virtual Hosting Hack (Older Clients) Reply with quote

Virtual Hosting did not exist in older web browsers, so I thought of an idea
to redirect them to a certain web page. This method actually works, I used
WebBug to test it. Do a Google search and try WebBug with this.

In order for this to work, your default host will be the target for these old
timers. If a Virtual Host fails, they will end up on the default host. You will
need to rename your default host's index.html to index.php

Once you renamed the index.html to index.php, you insert the following
code at the very top of your index.php file before the HTML.

Note: This also works with ::Virtual Host Creator::, I recommend buying
the Professional version of Abyss Web Server, if you want true V. Hosting.

Note: You also need to have PHP installed for this to work.
http://www.aprelium.com/abyssws/php.html

Code:

<?php
if (!isset($_SERVER["HTTP_HOST"])) {
 header("Location: /vhost_error.html");
 exit;
}
?>


The vhost_error.html page, should have information saying that the
browser failed to send the HTTP_HOST header, and that they should
upgrade their browser and try the website address again.

Example: http://www.trustabyss.com/vhost_error.html

Sincerely, TRUSTpunk
Back to top View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> Tutorials All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group