Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section Web Server
  • Search

Wordpress Nginx + php fpm ERROR 404 with custom permalink

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Post Reply
  • Print view
Advanced search
8 posts • Page 1 of 1
kablakar
Posts: 10
Joined: Sun Mar 01, 2015 6:16 pm

Wordpress Nginx + php fpm ERROR 404 with custom permalink
  • Quote

Post by kablakar » Tue Mar 01, 2016 11:40 pm

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 ?
Top

tjebbeke
Collaborator
Posts: 783
Joined: Mon May 11, 2015 8:43 am
Contact:
Contact tjebbeke
Website

Os: CentOS 6x
Web: apache + nginx
Re: Wordpress Nginx + php fpm ERROR 404 with custom permalink
  • Quote

Post by tjebbeke » Wed Mar 02, 2016 7:58 am

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
Top

Clouseau
Posts: 20
Joined: Fri Mar 04, 2016 8:39 pm

Re: Wordpress Nginx + php fpm ERROR 404 with custom permalink
  • Quote

Post by Clouseau » Fri Mar 04, 2016 8:58 pm

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...
Top

daz1uk
Posts: 25
Joined: Fri Apr 22, 2016 3:32 pm

Re: Wordpress Nginx + php fpm ERROR 404 with custom permalink
  • Quote

Post by daz1uk » Sun May 01, 2016 3:12 pm

Has anyone resolved this please?
Top

daz1uk
Posts: 25
Joined: Fri Apr 22, 2016 3:32 pm

Re: Wordpress Nginx + php fpm ERROR 404 with custom permalink
  • Quote

Post by daz1uk » Sun May 01, 2016 3:40 pm

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.
Top

Falzo
Posts: 60
Joined: Mon Mar 28, 2016 8:49 am

Re: Wordpress Nginx + php fpm ERROR 404 with custom permalink
  • Quote

Post by Falzo » Mon May 02, 2016 7:20 pm

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.
Top

lotusming
Posts: 16
Joined: Fri Jun 10, 2016 6:34 pm

Re: Wordpress Nginx + php fpm ERROR 404 with custom permalink
  • Quote

Post by lotusming » Mon Oct 17, 2016 4:04 pm

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.
Top

bgbs
Posts: 13
Joined: Fri Jun 21, 2019 10:13 pm

Os: Ubuntu 17x
Web: apache + nginx
Re: Wordpress Nginx + php fpm ERROR 404 with custom permalink
  • Quote

Post by bgbs » Tue Jun 25, 2019 7:35 pm

You need to head over to /home/user/conf/web/youdomain.com.nginx.conf

And add this line between inside location / { }

Code: Select all

index index.php index.html;
        if (!-e $request_filename)
        {
                rewrite ^/(.+)$ /index.php last;
        }
Top


Post Reply
  • Print view

8 posts • Page 1 of 1

Return to “Web Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password