seoger
By:
seoger

Getting W3TC To Work on Nginx - Help!

August 14, 2015 409 views
WordPress Nginx Ubuntu

Hi,

I recently managed to get Wordpress permalinks to work so that the post-name option worked, so I could view the actual page name when viewing my website in a browser. I did this by adding the following line of code:

location / { 
try_files $uri $uri/ /index.php?$args; 
} 

in the following nginx config file:
/etc/nginx/sites-available/domain.com

BUT the problem I’m now having is trying to get the W3TC cache plugin to work. I have been following the article here…https://john-dugan.com/setup-w3tc-nginx/.

What I did was add another line of code in the same file i.e. /etc/nginx/sites-available/domain.com as follows to the existing line of code I added earlier to get permalink to work…

location / { 
try_files $uri $uri/ /index.php?$args; 
include /home/domain/public_html/nginx.conf; 
} 

This fixed the W3TC problem and the plugin worked - BUT - it affects the permalinks line of code so that now when I try to access a Wordpress page in my browser, I just get a “404 Not Found” error.

Would really appreciate if someone else has managed to find a work around for this.

Thanks!

1 comment
Be the first one to answer this question.