Rewrite all requests to index.php with nginx

后端 未结 8 2227
陌清茗
陌清茗 2020-11-28 05:17

In my apache configuration I have the following simple rewrite rule which

  1. unless file exists will rewrite to index.php
  2. on the urls you never see the f
8条回答
  •  遥遥无期
    2020-11-28 05:44

    Perfect solution I have tried it and succeed to get my index page when I have append this code in my site configuration file.

    location / {
                try_files $uri $uri/ /index.php;
    }
    

    In configuration file itself explained that at "First attempt to serve request as file, then as directory, then fall back to index.html in my case it is index.php as I am providing page through php code.

提交回复
热议问题