Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Rewrite file.html as index.php?p=file.html

$
0
0
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.

Viewing all articles
Browse latest Browse all 4759

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>