RewriteRule ^brand-([0-9]+)-c([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)\.html 到 brand\.php\?id=$1 [QSA,L]范围内的内容修改
你这个提示是权限问题。可以用下面的方法解决:打开 httpd.conf 搜索Deny from all 修改为 Allow from all。或者添加Allow from localhost
如下:
# Require all granted# onlineoffline tag - don't remove
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Allow from ::1
Allow from localhost
</Directory>
另外告诉你如何设置虚拟目录。首先使虚拟配置文件生效,也就是去掉了httpd-vhosts.conf前面的#。#在配置文件中表示备注
# Virtual hosts#Include conf/extra/httpd-vhosts.conf
Include conf/extra/httpd-vhosts.conf
开启虚拟配置文件后要访问localhost,一定要在虚拟主机配置文件里面配置localhost域名指向本地wamp的www目录。或者其他目录
打开 httpd-vhosts.conf,配置localhost域名指向的目录,默认一般指向wamp/www目录,如下
<VirtualHost *:80>ServerAdmin webmaster@dummy-host.localhost
DocumentRoot "D:/wamp/www"
ServerName localhost
ServerAlias localhost
ErrorLog "logs/dummy-host.localhost-error.log"
CustomLog "logs/dummy-host.localhost-access.log" common
</VirtualHost>
上面配置后还不可以访问本地localhost。还需要让本地的ip也就是 127.0.0.1指向localhost这域名。
虚拟配置文件好处是可以设置n个虚拟主机。比如
我配置一个访问dedegbk.com的域名指向本地一个虚拟目录
<VirtualHost *:80>ServerAdmin webmaster@dummy-host2.dedegbk.com
DocumentRoot "D:/wamp/www/0dedecms/dedegbk"
ServerName dedegbk.com
ServerAlias
ErrorLog "logs/dummy-host2.dedegbk.com-error.log"
CustomLog "logs/dummy-host2.dedegbk.com-access.log" common
</VirtualHost>
设置好虚拟目录后接下来修改hosts来使127.0.01这个本机ip指向本地设置的虚拟主机
127.0.0.1 dedegbk.com127.0.0.1 localhost
好,接下来就是重启wamp使所有配置生效!
希望能帮到你!
欢迎分享,转载请注明来源:夏雨云
评论列表(0条)