httpd.conf中用于重写的模块如下:
LoadModule rewrite_module modules/mod_rewrite.so
.htaccess的路径:
c:\wamp\www\magentodev\.htaccess
因此在.htacess我有这个:
Options +FollowSymLinks RewriteEngine on RewriteCond %{REQUEST_URI} ^/boombottleh2o\+?$ RewriteRule (.*) /gu/boombottleh2o.php [NC,L,QSA] //some other ones
我期待尝试:
localhost/magentodev/boombottleh2o
代替:
localhost/magentodev/gu/boombottleh2o.php
它应该工作,因为它正在生产但不是localhost,我有wamp服务器apache,这里有一些配置:
在C:\ wamp\bin\apache\apache2.4.9\conf\httpd.conf中:
Options Indexes FollowSymLinks AllowOverride All Require local
这是不正确的,因为Anu说,所以我在C:\ wamp\bin\apache\apache2.4.9\conf\extra\httpd-vhosts.conf中更改为:
Options All AllowOverride All Order allow,deny Allow from all ServerAdmin localhost DocumentRoot C:/wamp/www/ ServerName localhost
我无法弄清楚出了什么问题,我感谢任何帮助
你C:/wamp/www/magentodev/.htaccess
喜欢这个:
ErrorDocument 404 default Options +FollowSymLinks RewriteEngine on RewriteRule ^boombottleh2o(/.*)?$ gu/boombottleh2o.php [NC,L]
mod_rewrite
参考文献:
Apache mod_rewrite简介
Apache mod_rewrite技术细节
Apache mod_rewrite深入细节
Apache mod_rewrite初学者的教程