我刚刚将我的所有网络文件复制到我的电脑,包括.htaccess文件。现在我在XAMPP上运行它。我有这个问题,这个.htaccess文件:.htaccess文件从现场服务器复制部分不在本地工作
DirectoryIndex otherindex.php //<<--this line works, it changes my index.
//but the rest is not: I need to redirecting all request (except existing dir/file) to index.php
RewriteEngine on
RewriteBase/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [QSA,L]
我不知道为什么它在活服务器上工作,但不在我的XAMPP。我怎样才能在两者上都能工作?请帮忙吗?
更新: 检查我httpd.conf
和得到这个注释掉:
LoadModule ssl_module modules/mod_rewrite.so
注:我将我的默认htdocs文件夹到其他位置。
您可以发布您的网站的.conf文件的设置?特别是标签之间的内容。 –
mattc
没有这样的事情,这只是XAMPP的新鲜安装。 – egig
'LoadModule rewrite_module modules/mod_rewrite.so'是你的注释* httpd.conf *文件吗?看起来.htacces文件被允许作为第一个指令工作,但不是'mod_rewrite'。另一方面,是否有错误,规则未被使用,究竟是什么问题? –