windows apache 动态域

发布于 2024-09-15 12:32:03 字数 1100 浏览 2 评论 0原文

我有 Windows 7 + Zend 服务器

在 httpd.conf 文件中我有:

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,deny
                Allow from all
            </Directory>

    </VirtualHost>

在 windows 主机文件中:

127.0.0.1 local-izbori.bg

在我的 .htaccess 文件中:

Options +FollowSymLinks

RewriteEngine on

RewriteRule !\.(js|ico|gif|jpg|png|css|php|doc|docx|pdf|swf|htm|php|htc)$ index.php

url 重写工作查找,例如: local-izbori.bg/members/register/

但动态子域,例如 < a href="http://ruse​​.local-izbori.bg/ruse​​" rel="nofollow noreferrer">http://ruse​​.local-izbori.bg/ruse​​ 返回:找不到服务器

有什么方法可以让所有子域都转到index.php 吗?

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,deny
                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 ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

已下线请稍等 2024-09-22 12:32:03

查看通配符子域。为了让它们正常工作,您需要将该子域添加到您的 DNS 中。
我假设你在windows上。不幸的是,Windows 不支持通配符定义,因此您必须在主机文件中为每个子域添加一行。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文