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 Permalink issue - PHP FPM & NGINX subfolder

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Post Reply
  • Print view
Advanced search
1 post • Page 1 of 1
kaleem
Posts: 5
Joined: Tue Jan 02, 2018 9:52 pm

Os: CentOS 5x
Web: apache + nginx
Wordpress Permalink issue - PHP FPM & NGINX subfolder
  • Quote

Post by kaleem » Sat Dec 31, 2022 5:34 pm

Hi All, i had an issue with Wordpress permalink.
My env is PHP-FPM & NGINX.

i tried wordpress2-rewrite templates but it dont work. i managed to fix the issue so wanted to post the solution here so others don't have to waste 2 days like me to fix the issue.
also, would prefer if is added to new verison of VestaCP.

basically I had wordpress installed in subfolder on domain.

so on domain https://kahrgroup.com and I had multiple subfolders with WordPress like /test1 , /test2 , /test3

if i allocate the default wordpress template (wordpress2_rewrite), it works good with install which reside in root but with any subfolder wordpress install when Permalink are changed to anything other than PLAIN they stop working and you get 404 error.

i created a new template (i have uploaded here for your reference if you want easy fix, just download these files and then copy these to templates folder and goto domain and click EDIT and select this template.

I have debian installed so templates reside in: /usr/local/vesta/data/templates/web/nginx/php-fpm (check with the distro you are using for right folder.)

https://kahrgroup.com/kaleem/wordpress-Subfolder.tpl

https://kahrgroup.com/kaleem/wordpress-Subfolder.stpl

One is for HTTP & 2nd for HTTPS (you need to copy both)

Major change was regex :

Code: Select all

 if (!-e $request_filename)
        {
            rewrite ^(/[^/]+) $1/index.php?q=$1 last;
        }
Hope it sorts it out for those who are struggling.

Regards,
Kaleem
Top


Post Reply
  • Print view
1 post • 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