Welcome! Log In Create A New Profile

Advanced

Nginx Rewrite for Wordpress and WPML

Posted by kevmille 
Nginx Rewrite for Wordpress and WPML
April 06, 2012 01:28PM
I am trying to get WPML (Wordpress Multi-language) plugin to run on Nginx without success. According to the WPML site, the Apache servers must have the following Rewrites:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

I put

try_files $uri $uri/ /index.php?q=$uri&$args;

in my Nginx virtual host configuration. I do not get an error. The goal is to have English content refer to domain.com, Japanese to domain.com/ja/ and Vietnamese to domain.com/vi/. In Wordpress I set permalinks to /%postname%/. So far I cannot seem to get the Japanese and Vietnamese content to open with the correct URIs.

Any suggestions? Below is my nginx virtual host config:

server {
listen 80;
server_name domain.com;
access_log /srv/www/domain.com/logs/access.log;
error_log /srv/www/test.protekus.com/logs/error.log;

location / {
root /srv/www/domain.com/public_html;
index index.html index.htm index.php;
try_files $uri $uri/ /index.php?q=$uri&$args;
}

location ~ \.php$ {
include /opt/nginx/conf/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME
/srv/www/domain.com/public_html$fastcgi_script_name;
}

This seems to be an issue with many WPML users that has not had a solution yet.

CEO, Protekus Security Solutions - Vietnam
http://www.protekus.com
Location, Saigon (HCMC), Vietnam
Re: Nginx Rewrite for Wordpress and WPML
April 04, 2014 10:24AM
Hi,

It's been a while since you posted this post... I encounter the exact same issue. Have you been able to fix it? Does anybody have a clue?

Thanks.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 129
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready