Two apache questions

Darrell Shandrow plug-discuss@lists.plug.phoenix.az.us
Fri, 10 Jan 2003 08:39:08 -0700


Hi Miles,

Please see answers below.

> I have two domain names, the second domain name is a mispelling of the
first.
> We registered this in the event that someone mispells the domain. The
> mispelled name is only one letter off from the correctly spelled name.
Which
> is the best way to have someone redirected from www.mispellednamefoo.com
> www.correctlyspellednamefoo.com.

Set up name-based virtual hosting for both domains, specifying the same
DocumentRoot for each domain.  Obviously, you could use IP based hosting as
well, but this would be a waste of addresses for two domains that will carry
exactly the same content...  :-)

> The second issue is a DocumentRoot issue. On our server the document root
now
> is /var/www/. We would like customers to be able to only use the domain
name.
> As it is now to get to the customers php page we have to specify the
entire
> url to the shopping cart which is /var/www/xcart/customer/home.php. When I
> specified the previous path in DocumentRoot quite a few images were broken
and
> then we could no longer log in to the admin page. Would a symbolic link
from
> /var/www/xcart/customer/home.php to /var/www/index.html correct this
issue?

The symbolic link solution should work, but *don't* link it to index.html...
That wouldn't work, since you're really running PHP code.  Instead, link it
to index.php, then add index.php to the list of index files the server is
able to process...  Hmmm, probably ought to be *extremely* carefully opening
this up wide; better specify the index.php option on only the specific
directory needed, or rather just don't use index.php in /var/www but rather
something like home.php...  You could always make an index.html that
redirects the browser to home.php or something...

Hope this helps.