We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on v1 candidate and expect to engage more with the community over the coming months. We are committed to open source, and we encourage contributors to help us build the future of Vesta.
Wordpress Nginx + php fpm ERROR 404 with custom permalink
Wordpress Nginx + php fpm ERROR 404 with custom permalink
i have installed in a new server a vesta panel (php-fpm), when install wordpress and use custom permalink the response is 404 when visit a website , similar problem to this viewtopic.php?f=29&t=10657
i tried different template (wordpress,wordpress2) but not work anyway.
how solve this ?
i tried different template (wordpress,wordpress2) but not work anyway.
how solve this ?
-
- Collaborator
- Posts: 783
- Joined: Mon May 11, 2015 8:43 am
- Contact:
- Os: CentOS 6x
- Web: apache + nginx
Re: Wordpress Nginx + php fpm ERROR 404 with custom permalink
Wordpress is using .htaccess files when you customize your permalinks. In PHP-fpm the .htaccess files aren't working so, you need to modify the templates.
https://codex.wordpress.org/Nginx
https://codex.wordpress.org/Nginx
Re: Wordpress Nginx + php fpm ERROR 404 with custom permalink
Php-fpm hasn't got anything to do with .htaccess files exept if there are options regarding php options (php.ini). The problem is that nginx doesn't read .htaccess files, it ignores them. So all those rewrites must be written in nginx configuration syntax...
Re: Wordpress Nginx + php fpm ERROR 404 with custom permalink
Has anyone resolved this please?
Re: Wordpress Nginx + php fpm ERROR 404 with custom permalink
Solved,
Add "try_files $uri $uri/ /index.php?$args;" to nginx.conf located at /home/user/conf/web/.
"try_files $uri $uri/ /index.php?$args;" Needs to be added to the location section of each website you host.
Add "try_files $uri $uri/ /index.php?$args;" to nginx.conf located at /home/user/conf/web/.
"try_files $uri $uri/ /index.php?$args;" Needs to be added to the location section of each website you host.
Re: Wordpress Nginx + php fpm ERROR 404 with custom permalink
you should rather edit the template you are using or create a new template based on another with your changes.
otherwise you're changes to those config files mentioned are _not_ permanent and will be overwritten next time you change something in vesta controlpanel regarding the domain settings.
otherwise you're changes to those config files mentioned are _not_ permanent and will be overwritten next time you change something in vesta controlpanel regarding the domain settings.
Re: Wordpress Nginx + php fpm ERROR 404 with custom permalink
Hey guys, I noticed i still get a 404 when I enabled letsencrypt SSL on the wordpress domain. Otherwise permalinks work fine with the location block above.
Re: Wordpress Nginx + php fpm ERROR 404 with custom permalink
You need to head over to /home/user/conf/web/youdomain.com.nginx.conf
And add this line between inside location / { }
And add this line between inside location / { }
Code: Select all
index index.php index.html;
if (!-e $request_filename)
{
rewrite ^/(.+)$ /index.php last;
}