By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,641 Members | 1,685 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,641 IT Pros & Developers. It's quick & easy.

Redirect Based on What They Typed In

P: n/a
Imagine your web hosting provider just permitted you to type
* and you still get to the website that they
host for you. Imagine you want to setup websites for your family like,, etc.

Well, this is a request and some information for you. First, here's
how you could use PHP to react to what they type in the URL:

<!-- save as index.php in /var/www/html on Linux Apache: -->
$headers = getallheaders();
if (in_array('', $headers)) {
if (in_array('', $headers)) {

So imagine your workstation is where you're developing and testing
this. What changes would you make to /etc/hosts, Apache, or something
else on your Linux system so that it accepts *

So, the request -- the reason I ask is I want to inform my web hosting
provider of the changes they can make to their Linux system so that I
can start using this PHP index.php script to redirect to various
websites under

For now, in experiment mode, I had to add and to /etc/hosts for to get this to work. But
I wish I could do something dynamically.

Jul 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.