隐藏了index.php之后如何让图片的解析不走php,直接通过apache

对apache 的rewrite 不懂

按论坛上的方法隐藏了index.php,发现 图片文件的解析任然走的php,怎么改rewrite让图片的解析直接通过apache?

比如现在是

Options +FollowSymLinks

IndexIgnore /

RewriteEngine on

if a directory or a file exists, use it directly

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

otherwise forward it to index.php

RewriteRule . index.php


所有访问图片的地址 http://xxx.com/img/xxx.jpg ,是通过框架来解析的图片地址,如何直接配置 rewrite 规则,使图片直接由apache来解析地址?

图片不存在的时候,才会去index

假设你的图片目录是网站根目录下的images,在url中你写成img,可参照下面的规则

RewriteRule img/(.*) images/$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . index.php