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
只有代碼,沒有其他人 –