CodeIgniter Forums
Rewrite url in CI - Printable Version

+- CodeIgniter Forums (
+-- Forum: Development (
+--- Forum: CodeIgniter 2.x (
+--- Thread: Rewrite url in CI (/thread-77153.html)

Rewrite url in CI - remake2020 - 07-25-2020

Hello friends

Currently I'm doing the rewrite url of codeigniter. Now need to show as .jpg to be cloudflare to cache images after editing to help the server heavy.

$ route ['seccimg.jpg'] = "home/convertimg";

-> this command it fails to run.

The reason is that it reads a .jpg file as an error file before going into the index.php in CI

But I don't know how to fix it. I'm using nginx centos 7

Thank you. sorry for my bad English

RE: Rewrite url in CI - jreklund - 07-26-2020

Hi, what are your convertimg doing? It dosen't matter if the url contains an .jpg or not, caching engines look for headers, so you need to use headers to tell what you are displaying.

RE: Rewrite url in CI - remake2020 - 07-26-2020

convertimg is editing the image (resize + add background + watermark ....)
I added .jpg to dc cache from cloundflare to save bandwidth + cpu

RE: Rewrite url in CI - jreklund - 07-26-2020

Is it displaying it or saving it? If you just convert it and never use it. It would not matter.
You will also need to have a unique url, or cache servers don't pick it up as new.