【发布时间】:2018-11-01 13:34:10
【问题描述】:
我已经使用 codeigniter 在我的本地主机上设置了虚拟主机,它工作正常。但我无法创建通配符子域。下面添加虚拟主机是我在windows机器上的步骤。
C:\Windows\System32\drivers\etc\hosts.txt
在这个host.txt中我添加了下面的行
127.0.0.1 localhost.com
我正在使用 xampp 。我在 httpd-vhosts.conf 文件中添加了以下行。 D:\xampp\apache\conf\extra\httpd-vhosts.conf
<VirtualHost localhost.com:80>
DocumentRoot "D:/xampp/htdocs/adeptra"
ServerName localhost.com
ServerAlias localhost.com
<Directory "D:/xampp/htdocs/adeptra">
Options Indexes FollowSymLinks
AllowOverride All
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "D:/xampp/htdocs/adeptra"
ServerName localhost.com
ServerAlias *.localhost.com
<Directory "D:/xampp/htdocs/adeptra">
Options Indexes FollowSymLinks
AllowOverride All
</Directory>
</VirtualHost>
下面是我删除 index.php 的 .htaccess 代码
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
所以现在我的问题是,真的可以在 localhost 中创建通配符子域吗?如果是,那么请在这方面帮助我。任何帮助将不胜感激。
【问题讨论】:
标签: codeigniter localhost subdomain wildcard