wordpress website urls not working

Hello, wordpress inner pages urls is not working when it set to "Post name", only work with 'Plain' url setting, when i check the error log i see this
[error] 2606#2606: *3481 "/home/user/domains/bikinibodyguidereview.net/public/category/blog/index.php" is not found (2: No such file or directory), client: 182.190.83.67, server: bikinibodyguidereview.net, request: "GET /category/blog/ HTTP/2.0", host: "bikinibodyguidereview.net", referrer: "https://bikinibodyguidereview.net/"

can anyone give some small guidance to solve this issue. thanks

5 Replies

Linode Staff

Hi @eudechime! Some WordPress themes or plugins can require a specific URL style, or can conflict with URL styles. is 'plain' URL the only style you can select, or is 'post name' URL style the only one that's not working? Either way, I'd recommend making sure WordPress and all the plugins you're using are up to date, along with your theme.

Another possibility is that mod_rewrite isn't yet enabled on your Linode. This is the mod that allows .htaccess to rewrite URLs. You can enable it with the following commands:

sudo a2enmod rewrite
sudo service apache2 restart

plain url is currently working fine, but selecting 'post name' or custom url structure then i got 404 error,
when i try sudo a2enmod rewrite

i am getting sudo: a2enmod: command not found

Linode Staff

It may be that you're logged in as root. Could you try it without the 'sudo' portion?

If you're using NGINX or CentOS then a2enmod wouldn't be an available command. For CentOS mod_rewrite is enabled by default and for NGINX it's used in a different way. There's a post on the NGINX website on configuring rewrites that may help:

https://www.nginx.com/blog/converting-apache-to-nginx-rewrite-rules/

However, if you're not familiar with NGINX it may be better to use Apache instead since it's a bit more work than just using mod_rewrite, which WordPress expects.

CentOS 6.8, Linode this is server information and command is still not working i feel due to centos

this is setting on config file
https://prnt.sc/ur1vm3

site url not working:
https://bikinibodyguidereview.net/10-best-clickbank-health-affiliate-products-to-promote-in-2020/

Linode Staff

Thanks for the info. It does look like you're using NGINX so you'll need to configure the rewrites in a different way. There's an official WordPress guide on doing so here:

https://wordpress.org/support/article/nginx/

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct