Original Poster Posted June 10, 2015 Share Posted June 10, 2015 hello! I am trying to get my nginx to go to index.php if on the root URL (www.example.com). at the moment this is my location / as you can see I rewrite anything with view.php as its exstention... I can visit index.php but it wont display by default... any help? location / { #limit_rate 512k; root /var/www; index index.php; client_max_body_size 20M; try_files $uri $uri.php =404; if (!-e $request_filename){ rewrite ^(.*)$ $1.view.php; } } Link to comment Share on other sites More sharing options...
Sikh Posted June 10, 2015 Share Posted June 10, 2015 In your nginx.conf change default_type to text/html and then change index to index.php index.html; Heres some resources: http://nginx.org/en/docs/http/ngx_http_core_module.html#default_type http://nginx.org/en/docs/http/ngx_http_index_module.html#index Link to comment Share on other sites More sharing options...
Original Poster Posted June 11, 2015 Author Share Posted June 11, 2015 yea cheers I got it working needed to do an = / (which I had never seen used before ) either way its all gravy now In your nginx.conf change default_type to text/html and then change index to index.php index.html; Heres some resources: http://nginx.org/en/docs/http/ngx_http_core_module.html#default_type http://nginx.org/en/docs/http/ngx_http_index_module.html#index Sikh 1 Share Link to comment Share on other sites More sharing options...
Recommended Posts