我正在尝试在我的本地 wamp 服务器上使用自适应图像。ai-cache 文件夹没有出现,图像根本没有被替换。根据这个线程,我尝试RewriteRule .(?:jpe?g|gif|png)$ test.jpg
在 .htaccess 文件中并将 test.jpg 添加到同一文件夹中,但这并没有改变任何内容。
在 wamp 菜单中 Apache->Apache Modules->rewrite_module 被选中,并且在 httpd.conf 中未注释LoadModule rewrite_module modules/mod_rewrite.so
每当我更改 .htaccess 时,我都会重新启动 wamp 中的所有服务。此外,如果我asdf
在顶部写它确实会给出 500 Internal Server Error 所以我知道文件正在被读取。
我究竟做错了什么?
这是位于几个子目录 (www/demos/test/) 中的 .htaccess 文件:
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
# Adaptive-Images -----------------------------------------------------------------------------------
# Add any directories you wish to omit from the Adaptive-Images process on a new line, as follows:
# RewriteCond %{REQUEST_URI} !ignore-this-directory
# RewriteCond %{REQUEST_URI} !and-ignore-this-directory-too
RewriteCond %{REQUEST_URI} !assets
# don't apply the AI behaviour to images inside AI's cache folder:
RewriteCond %{REQUEST_URI} !ai-cache
# Send any GIF, JPG, or PNG request that IS NOT stored inside one of the above directories
# to adaptive-images.php so we can select appropriately sized versions
RewriteRule \.(?:jpe?g|gif|png)$ adaptive-images.php
# END Adaptive-Images -------------------------------------------------------------------------------
</IfModule>
这是我的 httpd.conf 部分:
#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "c:/wamp/www/">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
Options None
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride all
#
# Controls who can get stuff from this server.
#
# onlineoffline tag - don't remove
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Allow from ::1:
</Directory>