Location Rewrite Issue

Randy Johnson randy at randy.cc
Fri Aug 16 17:01:29 UTC 2019


Thank you.  That was indeed the issue.  Now  I can see the individual blog
entries at /blog/slug-of-blog

but /blog and /blog/ urls are both throwing a 404.

Is that an easy fix?

-Randy

On Fri, Aug 16, 2019 at 5:15 AM Reinis Rozitis <r at roze.lv> wrote:

> > I tried adding the following line in there in a couple different places
> but all it does is download the php file.
> >
> > location /blog {
> > rewrite ^/blog/([A-Za-z0-9-]+)/?$ /blog-article.php?slug=$1 break;
> > }
>
> Try to switch from 'break' to 'last'.
>
> By using 'break' it means that nginx stops the rewrite and also doesn't
> search for any other location so the request doesn't land in the 'location
> ~ \.php$' and is never processed by php.
>
> rr
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20190816/6f6c2a37/attachment.html>


More information about the nginx mailing list