我有一个关于指向子域到一个目录的两个问题:指向子域的“目录”
目前我跑的地方,但我可以在我成立了一个假的域中运行我的网站(与主机文件),其名为mysite.com。我怎么能(通过服务器设置?)这样做所有子域将指向/?示例anders.mysite.com也应显示mysite.com和asdassdd.mysite.com。
也许1.没有必要,但我如何通过htaccess将anders.mysite.com指向mysite.com/anders?重要提示是不应该重定向。
为什么我认为的1,是因为我不想在htaccess的或任何Apache /域设置,该子域是什么的任何位置指定,因为这将是动态的(创建由已登录的用户在我webapplication)
当前用户可以使用mysite.com/anders/这是他们创建的URI,而不是真实的目录。在Kohana bootstrap中,我抓取URI并显示相关的用户页面。
我使用Kohana的MVC框架,并在我的htaccess有这样的:
# Turn on URL rewriting
RewriteEngine On
# Installation directory
RewriteBase/
# Protect hidden files from being viewed
<Files .*>
Order Deny,Allow
Deny From All
</Files>
# Protect application and system files from being viewed
RewriteRule ^(?:application|modules|system)\b.* index.php/$0 [L]
# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Rewrite all other URLs to index.php/URL
RewriteRule .* index.php/$0 [PT]
任何帮助表示赞赏!
我的hosts文件有127.0.0.1 mysite.com和我的httpd-vhosts.conf现在有: <虚拟主机*:80> ServerAlias * .mysite.com 虚拟主机> 但我仍然无法达到blabla.mysite.com上的文档根目录。我错过了什么吗? – Karem
为了澄清,我的需求是,Kohana应该阅读blah.mysite.com/page/stuff,因为它是mysite.com/blah/page/stuff – Karem
因为我不是真正的mysite。com,我用hosts文件让浏览器认为我是。 – Karem