Hello
I recently decided to move from Apache to Nginx but having some problems getting my rewrite rules correct.
In apache the where:
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
RewriteRule ^/([^/]+)/([^/]+)\//?$ %{DOCUMENT_ROOT}/data.php?type=$1&data=$2 [L]
And my nginx config looks like:
server {
listen 80;
server_name localhost;
location / {
root html;
index index.html index.htm;
if (!-d $document_root$request_filename) {
if (!-f $document_root$request_filename) {
rewrite ^/([^/]+)/([^/]+)\//?$ $document_root/data.php?type=$1&data=$2 last;
}
}
}
}
I would creatly apprechiate if someone could help me out with this, it does not seem to have any effect at all when visting for example http://localhost/thisone/doesnotexist/
And also is there a way to debug the rules?