.htaccess 将虚拟子域重定向到另一个文件

.htaccess 将虚拟子域重定向到另一个文件,.htaccess,url-rewriting,subdomain,virtualhost,wildcard-subdomain,.htaccess,Url Rewriting,Subdomain,Virtualhost,Wildcard Subdomain,我有虚拟子域,比如 现在当访问这个url时,我想显示页面index2.php的内容,而不是index.php,所以当访问索引页面和 我试图编辑htaccess文件,但没有成功。 我应该在文件上定义哪些条件 查看我使用的代码,将文件放在名为subdomain的文件夹中,但它无法正常工作 Options +FollowSymLinks RewriteEngine On RewriteCond %{HTTP_HOST} ^(.*)\.website\.com RewriteRule ^(.*)

我有虚拟子域,比如

现在当访问这个url时,我想显示页面index2.php的内容,而不是index.php,所以当访问索引页面和

我试图编辑htaccess文件,但没有成功。 我应该在文件上定义哪些条件

查看我使用的代码,将文件放在名为subdomain的文件夹中,但它无法正常工作

 Options +FollowSymLinks
 RewriteEngine On
 RewriteCond %{HTTP_HOST} ^(.*)\.website\.com
 RewriteRule ^(.*)$ http://website.com/subdomains/%1/$1 [L,NC,QSA]

使用Apache的mod_userdir怎么样?假设您运行的是Apache,您尝试了什么?请显示您的代码…嗨,请看上面我已经粘贴了代码