view without password - nginx
Aaron-Online opened this issue · 4 comments
When I click view without password , the browser doesn't show any content. I am using Nginx.
When I click view without password , the browser doesn't show any content. I am using Nginx.
You should change your "nginx.conf", the ".htaccess" doesn’t work for Nginx, so add configs following:
location / {
if ($query_string ~ "^view") {
rewrite ^/([a-zA-Z0-9]+(-[a-zA-Z0-9]+)*)$ /view.php?note=$1 last;
}
if ($query_string ~ "^simple") {
rewrite ^/([a-zA-Z0-9]+(-[a-zA-Z0-9]+)*)$ /simple.php?note=$1 last;
}
rewrite ^/([a-zA-Z0-9]+(-[a-zA-Z0-9]+)*)$ /index.php?note=$1 last;
}
}
add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive";
When I click view without password , the browser doesn't show any content. I am using Nginx.
You should change your "nginx.conf", the ".htaccess" doesn’t work for Nginx, so add configs following:
location / { if ($query_string ~ "^view") { rewrite ^/([a-zA-Z0-9]+(-[a-zA-Z0-9]+)*)$ /view.php?note=$1 last; } if ($query_string ~ "^simple") { rewrite ^/([a-zA-Z0-9]+(-[a-zA-Z0-9]+)*)$ /simple.php?note=$1 last; } rewrite ^/([a-zA-Z0-9]+(-[a-zA-Z0-9]+)*)$ /index.php?note=$1 last; } } add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive";
I tried and it works perfect. Thank you for your reply
Thanks both for the fix and for testing. I've pinned this issue, added the example from @eonegh into the project and readme. I don't have an nginx setup to test on so if you have anything else useful to add for nginx then please let me know and I will add it in to the project.
Thanks, Dom