I have put in the rewrite rules for permalink for wordpress, but I kept getting 404 messages when I browse to other pages only the homepage works. Anyone can help?
Code:
server {
listen 80;
server_name www.topdesignblogs.com topdesignblogs.com;
access_log /home/tony/public_html/topdesignblogs.com/logs/access.log;
error_log /home/tony/public_html/topdesignblogs.com/logs/error.log;
location / {
root /home/tony/public_html/topdesignblogs.com/public;
index index.php;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?q=$1 last;
break;
}
}
location ~ \.php$ {
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /home/tony/public_html/topdesignblogs.com/public$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
}
}
Broswser Error Message:
Not Found
The requested URL /uncategorized/test/ was not found on this server.
Apache/2.2.8 (Ubuntu) mod_perl/2.0.3 Perl/v5.8.8 Server at topdesignblogs.com Port 80