Apache Rewrite domain.com->index.php domain.org->index2.php

Apache Rewrite domain.com->index.php domain.org->index2.php

Post by Thomas Bossha » Tue, 13 Aug 2002 17:06:02



Hello

is it possible to make something like this

the domain.com and domain.org "shows" to the same file index.php
on the server.

But i want somethingh like this

domain.com -> /index.php
domain.org -> /index2.php

and this should be done in .htaccess

can anybody help me?

thanx in advance
Thomas Bosshard

 
 
 

Apache Rewrite domain.com->index.php domain.org->index2.php

Post by Klaus Johannes Rusc » Tue, 13 Aug 2002 20:36:33



> is it possible to make something like this

> the domain.com and domain.org "shows" to the same file index.php
> on the server.

> But i want somethingh like this

> domain.com -> /index.php
> domain.org -> /index2.php

> and this should be done in .htaccess

You can set diffent access config filenames for each virtual server in
httpd.conf, then use

.htaccess_com: DirectoryIndex index.php
.htaccess_org: DirectoryIndex index2.php

Or use mod_rewrite to rewrite the request based on the hostname, or even
better and more portable, change index.php to check for the hostname and
perform the appropriate action.

--
Klaus Johannes Rusch

http://www.atmedia.net/KlausRusch/

 
 
 

1. myname@host.domain.com --> myname@domain.com ??

Hi,
I've configured a sendmail 8.9.X that comes with solaris 7
and I'm using BIND 8 for the DNS.

it is ok with send and receive email. However, when I send
the mail out from my mail server. The hostname of that server
will comes out with the domain address automatically.
How can I remove it ??


I have check with the faq in sendmail.org, but it seems I cannot find an answer.
Any suggestion will be highly appreicated!

Thanks.
Philip

2. Jaz 1G removable hard-drive

3. Sendmail and header rewriting joe@mail.domain.com to joe@domain.com

4. NFS: Error message from portmap?

5. Apache w/ PHP and SSL: w/ PHP OK - w/out PHP NOK

6. increasing ulimit for core files

7. Sendmail and host.domain.com instead of domain.com

8. "Screen Blanker" and Virtual TTY control

9. Resolving domain.com as well as name.domain.com

10. apache + php + basic auth => password theft => solutions?

11. Apache->PHP-mail()->sendmail problem Debian 3.1

12. Apache Redirect/ReWrite for redirecting old->new domains?

13. Apache rewrite: multiple domains --> singledomain/directory