【发布时间】:2016-09-29 04:10:13
【问题描述】:
我在我的 WAMP 服务器下为移动站点创建了一个子域,它使用 IP 地址作为域名,即192.168.106.1
但问题是,当我尝试在我的 .htaccess 文件中重写一个 url 时,我不起作用。我使用了一个重复的.htaccess 文件,它适用于localhost
下面是我httpd.conf文件中域名的服务器配置
<VirtualHost 192.168.106.1>
#LoadModule rewrite_module modules/mod_rewrite.so
# The name to respond to
ServerName m.localhost
# Folder where the files live
DocumentRoot "C:/wamp/www/mobile/"
# A few helpful settings...
<Directory "C:/wamp/www/mobile/">
Allow from all
Order Allow,Deny
# Enables .htaccess files for this site
AllowOverride All
</Directory>
# Apache will look for these two files, in this order, if no file is specified in the URL
DirectoryIndex index.html index.php
</VirtualHost>
我还删除了第二行的注释标签,但它仍然不起作用。
请有解决方案的人?
【问题讨论】:
标签: .htaccess url-rewriting wamp subdomain