windows apache dynamic domain
I have Windows 7 + Zend server
In httpd.conf file i have:
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin keyne@localhost
ServerName local-izbori.bg
ServerAlias *.local-izbori.bg
DocumentRoot "C:\Program Files\Zend\Apache2\htdocs\izbori-www"
<Directory 'C:\Program Files\Zend\Apache2\htdocs\izbori-www'>
DirectoryIndex index.php
AllowOverride All
Order allow,de开发者_运维问答ny
Allow from all
</Directory>
</VirtualHost>
in windows host file:
127.0.0.1 local-izbori.bg
And in my .htaccess file:
Options +FollowSymLinks
RewriteEngine on
RewriteRule !\.(js|ico|gif|jpg|png|css|php|doc|docx|pdf|swf|htm|php|htc)$ index.php
url rewrite work find, ex: local-izbori.bg/members/register/
but dynamic subdomain, like http://ruse.local-izbori.bg/ruse return: Server not found
is there any way to do all subdomain to go to index.php ?
Look into wildcard subdomains. In order for them to work you need to add that subdomain to your DNS. I asume you are on windows. Unfortunately windows does not support wildcard definition so you will have to add a line for each subdomain to your hosts file.
精彩评论