apache - DirectoryIndex - php page with arguments

159 views Asked by At

I've got a single tikiwiki instance and several domain names. I want domain-1.com to have a homepage at domain-1.com/tiki-index.php?page-1. And then I want domain-2.com to have a homepage at domain-2.com/tiki-index.php?page-2. Both will internally map to the same tikiwiki instance.

I.e. I want several domains to point to the same tikiwiki instance. But coming from different domains should land you at different home pages. And then user could manually navigate from domain-1.com/tiki-index.php?page-1 (hompage) to domain-1.com/tiki-index.php?page-2

I tried to do this by setting DirectoryIndex but looks like it ignores all page arguments, i.e. ?page-1.

Any clues how to make an index page with arguments?

1

There are 1 answers

0
Andrey On

did it mylsef

RewriteEngine on
RewriteCond %{REQUEST_URI}  "^/$"
RewriteRule ^(.*) "http://domain-1.com/tiki-index.php?page=page-1"

The key here is to set rewrite condition to match empty URI, that is the default address - http://domain-1.com