Dngr.us unnesacaraly redirects 3 times

fyi, this was the bit that worked;

    error_page 404 = @notfound;
    location @notfound {
            rewrite ^/(.*)$ https://forum.dangerousthings.com/search?q=$1 last;
    }
2 Likes

Yeah, I should have said that This is part of the rewrite rules. The example I rewrote (regex are not an issue, nginx I don’t use often) came from this blog post.

I am glad you got it working. (Fixed the URL)

that’s awesome! could you add the same rule to the base url to search the store too?
And f.dngr.us gives a 403 error so doesn’t redirect to the forum

fixed

actually after messing about with it a bit I realized I can’t… the reason is that I don’t have hardly any of the products set up in this way as explicit redirects… for example, dngr.us/next is not actually set up to redirect… I rely on the default redirect to a product page to do this… so if I changed all 404s to redirect to the search, then all my product shortlinks would redirect to search results instead… less elegant :confused:

2 Likes

ah, fair. All good
maybe you could have a rule on the store that 404s redirect to a search?

possibly… there is already some sort of redirect mechanism at work there… kinda like a pseudo-search function… basically if you’re kinda close to a product name it will just assume you meant that product… but it’s very low intelligence.

1 Like