It is a working example on Apache AddDefaultCharset UTF-8
<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?_url=/$1 [QSA,L] </IfModule>
My configuration file
server {
listen 80 default_server;
charset utf-8;
root /usr/share/nginx/html;
index index.php index.html index.htm;
server_name localhost;
location / {
try_files $uri $uri/ =404;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ .php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
location /resource{
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
if (!-e $request_filename){
rewrite ^(.*)$ /resource/index.php?_url=/$1 last;
break;
}
}
location ~ /\.ht {
deny all;
}
}
Code $app->get('/', function () { echo 'test'; });
GET www.site.com/resource/ answer Access denied
GET www.site.com/resource//index.php answer test