nginx - Cant access the index file with the extension removed -


i'm using following rule on nginx in order remove /index.php , make hust /index when i'm browsing site folder example says no input file specified. way fixit or redirect /example /example/index ?

this code i'm using remove .php extension

  if (!-f $request_filename){             set $rule_0 1$rule_0;     }     if ($rule_0 = "1"){             rewrite ^/([^.]+)$ /$1.php last;     } 

why need "not" have extension on file, specialy index file. if example.com/index.php , use example.com/ it's same thing. webserver knows display.

if want parse files no extension php files need change nginx configuration files run php cgi read files not .php or older .php3 php files, , parse them properly. (it's not advised may result in webserver problems.. nobody that)


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -