Hi all,
Recently, I was asked to write a piece of code for a group of friends, and after completion, was told the server ran on NGINX. I've been reading the documentation to convert the htaccess I made to an equivalent for NGINX, but to no avail. I'm hoping someone can help.
Here is the htaccess I have.
[quote]ErrorDocument 401 errors/401
ErrorDocument 403 errors/403
ErrorDocument 404 errors/404
Options -Indexes +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_URI} !/test\d?.php$
RewriteCond %{REQUEST_URI} !/test/.*$
RewriteCond %{REQUEST_URI} !/input.php$
RewriteRule !\.(css|jpg|js|gif|png|ico)$ dispatch.php[/quote]
The server already contained this code on it:
[quote]server {
server_name tools.eveuniversity.org;
root /var/www/tools;
location ~ \.php$ {
root /var/www/tools;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
index /index.php /index.html;
access_log /var/log/www/tools-access.log;
error_log /var/log/www/tools-error.log;
}
[/quote]
So I tried to add this above the index command:
[quote]error_page 401 errors/401
error_page 403 errors/403
error_page 404 errors/404
rewrite !\.(css|jpg|js|gif|png|ico)$ dispatch.php[/quote]
This didn't work (still forwarded to index.php). So I deleted the index command, and then instead got a 404 error (the server default). I tried changing the error_page info to 401.php, 403.php, 404.php but still got the server default error rather then my custom ones.
Basically, I'm not quite sure what I'm doing wrong or how to fix it. Hopefully someone can help.