New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.


Comments
htaccess
Did you even read the thread?
as far as I know htaccess will not work in nginx
htaccess is not working for nginx servers. correct me if I'm wrong.
Sorry didn't read it totally @Brad
server {
server_name www.vpsraid.com;
root /var/www;
}
check the above
you want rewrite or redirect to?
/filename/aaa = /filename.php?file=aaa
rewrite ^/filename/(.*) /filename.php?file=$1 last;
}
sorry this part not working
rewrite
should working then, have you restart nginx yet?
did you copy the whole thing ?
server {
server_name www.vpsraid.com;
root /var/www;
too ?
<-->
restarted, but nothing change. I already have these two lines.
try_files $uri $uri/ @extensionless-php;and
location @extensionless-php { rewrite ^(.*)$ $1.php last; }so I add this
rewrite ^filename/(.*)$ /filename.php?file=$1 last;line underlocation @extensionless-phpis that the problem ?put below
location / {
........
http://pastebin.com/M3qmVsRY
here is what i have in my configuration file
( I replace example as my real domain name )
server { server_name www.example.com; access_log /home/webserver/example/logs/www/access.log; error_log /home/webserver/example/logs/www/error.log; root /home/webserver/example/public_html/www; index index.html index.htm index.php; rewrite ^/filename/(.*)$ /filename.php?file=$1 last; location / { try_files $uri $uri/ @extensionless-php; } location @extensionless-php { rewrite ^(.*)$ $1.php last; } location ~ \.php$ { include /etc/nginx/fastcgi_params; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } location ~ \.(aspx|jsp|cgi)$ { return 410; } }server { > server_name www.example.com; > access_log /home/webserver/example/logs/www/access.log; > error_log /home/webserver/example/logs/www/error.log; > root /home/webserver/example/public_html/www; > index index.html index.htm index.php; > rewrite ^/filename/(.*)$ /filename.php?file=$1 last; > > location / { > try_files $uri $uri/ extensionless-php; > } > > location extensionless-php { > rewrite ^(.*)$ $1.php last; > } > > location ~ \.php$ { > include /etc/nginx/fastcgi_params; > fastcgi_pass 127.0.0.1:9000; > fastcgi_index index.php; > fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; > } > > location ~ \.(aspx|jsp|cgi)$ { > return 410; > } > > }wooh ... finally it's work. thank you very much