dimanche 27 décembre 2015

Codeigniter windows server web.config - how to escape .jpg or images files from url

I have a codeigniter website in a Windows server and it seems to be working well after I used the web.config file. But the the problem is that i cannot pass .jpg files in the url. There is a function to delete image in my admin section as follows;

http://ift.tt/1ShsLEd

Which returns me a 404 not found error.

If I remove '|jpg|jpeg|png|gif|' from the pattern {REQUEST_FILENAME} of web.config , the delete function work, but no images are displayed in the website at all.

 <rule name="Rewrite to index.php">
                    <match url="index.php|robots.txt|images|test.php" />
                    <action type="None" />
                </rule>
                <rule name="Rewrite CI Index">
                    <match url=".*" />
                    <conditions>
                        <add input="{REQUEST_FILENAME}" pattern="^.+\.(css|js|jpg|jpeg|png|gif|ico|htm|html|eot|woff|ttf|svg|txt|pdf|swf)$" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="index.php/{R:0}" />
                </rule>

is there a workaround for this. Many thanks for checking it.

Aucun commentaire:

Enregistrer un commentaire