Rewrite file.html as index.php?p=file.html
September 10, 2015 10:42AM
Hello all,

I'm trying to configure nginx to rewrite a subdirectory so that when any .html file is requested it is rewritten on the back end to a php args. So far I have the following:

location /subdirectory/ {
try_files $uri /subdirectory/index.php?p=$args;
}

However, whenever I request an html file it just give me a 404. I'm not sure how to tell nginx to include .html files in the rewrite. Any help is appreciated.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 157
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