I’ve installed WordPress on a LEMP stack. When I go to a nonexistent url, I’m redirected to my site’s homepage. I don’t want this to happen. I want a nonexistent url to redirect to WordPress’s 404 page.
How can I get this to work on a LEMP stack?
For reference, here is my site: https://sequential.design/whatisthis/ https://sequential.design/holyhamster/ https://sequential.design/put anything here/
I used the Digital Ocean tutorials to set up my droplet and this specific tutorial, https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-with-lemp-on-ubuntu-20-04, to install WordPress on my site, so my server settings are all standard.
I should mention that enabling pretty permalinks gets rid of this issue, but I want to use ugly permalinks.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi there @DanielAlejandro,
It looks like that the 404 page works as expected when visiting a plain page:
https://sequential.design/?p=12
However, you need to choose the permalinks setting for your website (can be found in Settings > Permalinks) so that they not set to Plain.
Let me know how it goes. Regards, Bobby
As I stated in my question, “I should mention that enabling pretty permalinks gets rid of this issue, but I want to use ugly permalinks.”
I want to use plain permalinks. And I want nonexistent URLs to redirect to WordPress’s 404 page. Thus your solution is inadequate. I want 404s to work with plain permalinks.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.