根据网上搜索的教程来配置apache 虚拟目录伪静态,结果还是无法实现,请大家帮忙找下原因,非常感谢!
第一步:开启伪静态
将httpd.conf中#LoadModule rewrite_module modules/mod_rewrite.so,取消注释
将AllowOverride None全部替换成AllowOverride All
第二步:开启虚拟目录
将httpd.conf中#Include conf/extra/httpd-vhosts.conf,取消注释
并在httpd-vhosts.conf中配置虚拟目录,虚拟目录内容如下
<VirtualHost 127.0.0.2> ServerAdmin admin@system DocumentRoot "F:/phpsite/myweb" ServerName 127.0.0.2 <Directory "F:/phpsite/myweb"> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory></VirtualHost>
<IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^/conf_([0-9]*).html /conf.php?arg=$1</IfModule>
配置虚拟机
6a6958036f1c02f5b279f26f33ef6a9b
DocumentRoot "F:/phpsite/myweb"
ServerName 127.0.0.1:8009
ErrorLog "logs/web.log"
ee672f0beb03b42be69279368a66a410
apache支持伪静态
ce73ac3697e0208cbda22f885850dd9a
Options Indexes FollowSymLinks MultiViews ExecCGI
AllowOverride All
Order allow,deny
Allow from all
bb15ed4aadeed04b3991578461de0768
RewriteRule conf_([0-9]*).html curl.php?arg=$1
这样试了下可以
非常感谢两位!纳闷了。我昨天写的正则居然不行。今天又正常了,太妖孽了!