我有一個域和一個子域(用於移動設備和客戶端)的共享主機。每個域和子域具有不同的默認索引頁面。由於我無法訪問httpd.conf,託管公司告訴我將所有內容都放入我的.htaccess文件中。根據.htaccess中的域/子域更改DirectoryIndex
我想這樣做是:
- 如果用戶去domain1.com的的
DirectoryIndex
應該是:index.html
- 如果用戶去mobile.domain1.com的
DirectoryIndex
應該是:mobile-index.html
- 如果用戶去post.domain1.com的
DirectoryIndex
應該是:post.php
- 如果用戶去vote.domain1.com的
DirectoryIndex
應該是:vote.php
編輯: 另外,如果我去domain1.com/page/的DirectoryIndex
應該是:index.html
。如果我去mobile.domain1.com/page/的DirectoryIndex
應該是:mobile-index.html
我可以把我的.htaccess文件以什麼改變DirectoryIndex
每個子域?
非常感謝你密歇根州
感謝您的澄清。感謝SetEnvIf,我認爲這樣更容易實現(而不是創建4個不同的文件)。謝謝 – Tech4Wilco
換句話說:在Apache啓動後'''不是動態的。 –
Geremia