Problem with permalinks in wordpress site within subfolder – we use nginx
-
Hello,
I know that there are several topics regarding permalinks, nginx and wordpress but our problem seems to persist..
We have a main wordpress site installed in a root directory and a second wordpress site installed in a subdirectory of the root directory (for a second language, /en). Permalinks work fine in the main site but they don’ t in the second…only default format works, once we change it to any other we get a 404 error…Could you help? Thank you in advance! The nginx conf file is as follows:
# # The default server # server { listen 80; server_name_in_redirect off; root /shared; index index.php index.htm index.html; #charset koi8-r; #access_log logs/host.access.log main; #access_log off; proxy_set_header X-Forwarded-Proto $scheme; set $myhttps ""; if ( $http_https = ON) { set $myhttps on; } location ~ /phpMyAdmin { root /usr/share/; index index.php index.html index.htm; fastcgi_buffer_size 128k; fastcgi_buffers 256 4k; fastcgi_busy_buffers_size 256k; fastcgi_temp_file_write_size 256k; fastcgi_read_timeout 240; location ~ ^/phpMyAdmin/(.+\.php)$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi_params; include /etc/nginx/fastcgi.conf; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } if (!-e $request_filename) { rewrite ^/(.*)/index.php/(.*)$ /$1/index.php last; } } location / { try_files $uri $uri/ /index.php?$args; } location /en { try_files $uri $uri/ /index.php?$args; } #location ~* /(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ { # return 403; # error_page 403 /403_error.html; # } error_page 404 /404.php; location = /404.php { root /shared/ypaithrosxwra/wp-content/themes/Newspaper-child; } # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi_params; include /etc/nginx/fastcgi.conf; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param HTTPS $myhttps; fastcgi_param PATH_INFO $fastcgi_script_name; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # location ~ /\. { deny all; access_log off; log_not_found off; } location ~ /htac { deny all; } location ~ /\.ht { deny all; } location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ { access_log off; log_not_found off; expires max; } location = /robots.txt { access_log off; log_not_found off; } }
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Problem with permalinks in wordpress site within subfolder – we use nginx’ is closed to new replies.