简体   繁体   中英

.htaccess using with codeigniter causes controller to be called as many times as missing pictures

Hello guys can you please help me with this problem. When a simple image (.png for example) is not found on the server. htaccess redirects it to my controler and it gets called as many times as missing pictures on the web site. My rewrite conditions are the following:

RewriteEngine on
RewriteCond $1 !^(index\.php|css|img|js|images|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]

Can you please provide me with a RerwriteCond which when picture is not found htaccess is not redirecting. Now when a picture with name "images/products/pic.png" htaccess sends it to server with Redirect_Url = "home/images/products/pic.png/". Or at least i think it's the htaccess.

There you go:

<IfModule mod_rewrite.c>
        RewriteEngine on
        RewriteCond $1 !^(index\.php|img\/.+|images\/.+|css\/.+\|js\/.+|robots\.txt)
        RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM