Answer the question
In order to leave comments, you need to log in
How can each mirror (alias) attach its main page?
Several more domains are attached to one domain by mirrors (alias).
It is necessary that each mirror (domain, alias) has its own index page.
But at the same time, it was possible to call the index.php file from the root (common home directory for each mirror).
If you select a folder under the main page, then the index.php request that lies at the root no longer works, since apparently it already considers the folder under the root.
RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain.xyz$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.domain.xyz$
RewriteCond %{REQUEST_URI} !domain/
RewriteRule (.*) /domain/$1 [L]
DirectoryIndex domain.html
Answer the question
In order to leave comments, you need to log in
I have two options:
1. Enter into index.php itself a check for the current URL/Domain and the absence of additional. parameters and make a simple type construction
if ($_SERVER['HTTP_HOST'] == 'domain1.com')
{
require('domain1.html'; exit;
}
//Остальной код
<If "%{HTTP_HOST} == 'www.example.com'">
DirectoryIndex domain.html
</If>
*I can't vouch for the correctness, perhaps the comparison operator for equality in .htaccess is written somehow differently... The Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question