2
我在我的电脑访问:http://www.laji.com
有www文件夹如何禁止img文件重写?
的.htaccess
Options +FollowSymLinks
RewriteEngine on
RewriteBase/
# All other pages
# Don't rewrite real files or directories
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^.*(\.css|\.js|\.gif|\.png|\.jpg|\.jpeg)$
RewriteRule ^(.*)$ index\.php?main_page=$1&%{QUERY_STRING} [L]
的index.php
<?php echo $_GET['main_page'] ?>
当我访问
http://wwww.laji.com/xxx.jpg
(这JPG下2个文件是不存在的),它重写为index.php?main_page = xxx.jpg,但我想让它显示404信息,不需要重写,为什么我的htaccess代码不起作用?
我收到了404当我去到一个不存在的使用规则JPG –
@ mingfish_004是个是你的htaccess中唯一的代码还是你还有其他规则? – anubhava
只有代码,没有其他人 –