CodeIgniter Forums
Caching when mod-rewrite enabled - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Caching when mod-rewrite enabled (/showthread.php?tid=13916)



Caching when mod-rewrite enabled - El Forum - 12-11-2008

[eluser]Unknown[/eluser]
I have CI setup to remove index.php via an .htaccess file and have put the index variable in config.php to "". This might just be my setup thats spooking, but i'd guess it goes for all that have rewritten their index.php file to ""

When using the page cache function in the output library i noticed all the md5 hashes didnt match up vs my own generated hashes, so i looked in the Output library - _write_cache() function:

Code:
$uri =    $CI->config->item('base_url').
                $CI->config->item('index_page').
                $CI->uri->uri_string();

        $cache_path .= md5($uri);
I echoed the $uri out and noticed that it generated: http://www.mysite.com//en/gallery instead of http://www.mysite.com/en/gallery, which you would expect. This makes it kind of hard to generate hashes.

I suppose it goes for everywhere the URI is generated in the same way.