我在下载的文件夹中有以下一组行,当在htaccess文件中打开时,我在htaccess文件中找到了这些行。
它与wamp服务器有关,我新安装在我的localhost中。
<IfModule mod_expires.c>
<FilesMatch ".(ico|gif|jpe?g|png|swf|css|js|txt)$">
ExpiresActive On
ExpiresDefault "access plus 1 day"
ExpiresByType image/gif "modification plus 1 day"
</FilesMatch>
</IfModule>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* ./index.php
Apache错误日志
[Tue Mar 17 14:33:05.181448 2015] [mpm_winnt:notice] [pid 6608:tid 528] AH00455: Apache/2.4.9 (Win64) PHP/5.5.12 configured -- resuming normal operations
[Tue Mar 17 14:33:05.182449 2015] [mpm_winnt:notice] [pid 6608:tid 528] AH00456: Apache Lounge VC11 Server built: Mar 16 2014 12:42:59
[Tue Mar 17 14:33:05.182449 2015] [core:notice] [pid 6608:tid 528] AH00094: Command line: 'c:\\wamp\\bin\\apache\\apache2.4.9\\bin\\httpd.exe -d C:/wamp/bin/apache/apache2.4.9'
[Tue Mar 17 14:33:05.186454 2015] [mpm_winnt:notice] [pid 6608:tid 528] AH00418: Parent: Created child process 5336
[Tue Mar 17 14:33:05.800324 2015] [mpm_winnt:notice] [pid 5336:tid 448] AH00354: Child: Starting 64 worker threads.
[Tue Mar 17 14:33:07.423483 2015] [core:alert] [pid 5336:tid 960] [client ::1:56548] C:/wamp/www/smart/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
这些是什么意思,你们可以帮助我吗
谢谢,
答案 0 :(得分:2)
[Tue Mar 17 14:33:07.423483 2015] [core:alert] [pid 5336:tid 960] [client :: 1:56548] C:/wamp/www/smart/.htaccess:命令无效 &#39; RewriteEngine&#39;,可能拼写错误或由模块定义 包含在服务器配置中的
Apache不知道是什么命令,因为你必须启用该模块。为了使大多数事情在Apache中工作,必须启用模块。现在有些是默认启用的,有些则不是。
您需要编辑Apache配置并取消注释module_rewrite行。
LoadModule rewrite_module modules/mod_rewrite.so