Welcome! Log In Create A New Profile

Advanced

How to get static caching working on urls without html extensions

Posted by paulswansea 
How to get static caching working on urls without html extensions
March 13, 2013 09:50AM
I have a website that i'd like to cache, the page urls are set up for example :

http://www.mywebsite.com/en/about-us

which i've set up a catch-all to the file index.php for processing.

I am able to generate files in the folder such as /en/about-us.html.gz on the fly, which is fine.

However, I don't want people to type in the .html extension at the end of the url just to get the static file, how do i get redirecting or whatever working, so that if the end user types in http://www.mywebsite.com/en/about-us , and the file /en/about-us.html.gz exists, then use that file, else just fall back to the catch-all. I'd also like it to take into account that if it's internet explorer, then provide a gunzip'd version of the cache file.

Is this at all possible in nginx, if so, can you post me the solution? I had it working in apache, but don't really want to go back to apache if I can help it.



Edited 1 time(s). Last edit at 03/13/2013 09:51AM by paulswansea.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 135
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready