How to remove extension with mor rewrite

Ninh Nguyen ninh.nv at gmail.com
Fri Nov 2 21:40:18 MSK 2007


How to auto add .php after filename with this kind of url: download?a=x&b=y&....
and auto add index.php if we type www.domain.com/ or domain.com/
I tried but it does not work

if (-f $request_filename/index.php) {
	        rewrite (.*) $1/index.php break;
	}
if (-f $request_filename.php) {
	        rewrite (.*) $1.php break;
	}





More information about the nginx mailing list