admin管理员组文章数量:1315792
I honestly did expect to get here...
I tried every tool in the book...
Save changes
on the permalinks
page...
I installed debug this
to see what going on with the query
...
I repeated other operations and changes to configurations but of no avail.
I've spent hours reading on .htaccess
params as well as nginx
server block configurations...nothing worx.
My menu
keeps on giving 404
unless I set permalinks
to plain
.
I am on linode VPS
, ubuntu 14.04
+ LEMP
stack
Here are my .htaccess
& my site's configs...
.htaccess
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
<Files 403.shtml>
order allow,deny
allow from all
</Files>
# Leverage Browser Caching Ninja -- Starts here
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType text/css "access 1 month"
ExpiresByType application/javascript "access plus 1 year"
</IfModule>
# Leverage Browser Caching Ninja -- Ends here
# compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
nginx server block
server {
server_name www.xxx xxx;
root /home/alma/xxx;
index index.php;
include global/restrictions.conf;
include global/wordpress_xxx.conf;
error_log /var/log/nginx/xxx_error.log;
access_log /var/log/nginx/xxx_access.log;
}
global/wordpress_xxx.conf
#
location / {
#try_files $uri $uri/ /index.php?$args;
try_files $uri $uri/ /index.php?q=$uri&$args;
}
# Add trailing slash to */wp-admin requests.
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
# Directives to send expires headers and turn off 404 error logging.
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;
}
# Pass all .php files onto a php-fpm/php-fcgi server.
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
# fastcgi_intercept_errors on;
fastcgi_param PHP_VALUE "upload_max_filesize = 16M \n post_max_size=18M";
client_max_body_size 68M;
include fastcgi_params;
}
location ~ ^/(wp-admin|wp-login\.php) {
auth_basic "Welcome - Admin Restricted Content";
auth_basic_user_file /etc/nginx/.htpasswd;
}
location = /wp-login.php {
deny all;
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
include fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PHP_VALUE "upload_max_filesize = 16M \n post_max_size=18M";
client_max_body_size 68M;
}
global/restrictions.conf
# Global restrictions configuration file.
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~ /\. {
deny all;
}
location ~* /(?:uploads|files)/.*\.php$ {
deny all;
}
These all worked prior to the last update
...
Has anyone encountered such an issue?
Does anyone know how to resolve this?
Is there something in my configuration that might be causing the issue after the update
to 4.8?
Thanx
P.s. the error logs are not showing anything in particular...
I honestly did expect to get here...
I tried every tool in the book...
Save changes
on the permalinks
page...
I installed debug this
to see what going on with the query
...
I repeated other operations and changes to configurations but of no avail.
I've spent hours reading on .htaccess
params as well as nginx
server block configurations...nothing worx.
My menu
keeps on giving 404
unless I set permalinks
to plain
.
I am on linode VPS
, ubuntu 14.04
+ LEMP
stack
Here are my .htaccess
& my site's configs...
.htaccess
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
<Files 403.shtml>
order allow,deny
allow from all
</Files>
# Leverage Browser Caching Ninja -- Starts here
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType text/css "access 1 month"
ExpiresByType application/javascript "access plus 1 year"
</IfModule>
# Leverage Browser Caching Ninja -- Ends here
# compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
nginx server block
server {
server_name www.xxx xxx;
root /home/alma/xxx;
index index.php;
include global/restrictions.conf;
include global/wordpress_xxx.conf;
error_log /var/log/nginx/xxx_error.log;
access_log /var/log/nginx/xxx_access.log;
}
global/wordpress_xxx.conf
# http://wiki.nginx/HttpCoreModule
location / {
#try_files $uri $uri/ /index.php?$args;
try_files $uri $uri/ /index.php?q=$uri&$args;
}
# Add trailing slash to */wp-admin requests.
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
# Directives to send expires headers and turn off 404 error logging.
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;
}
# Pass all .php files onto a php-fpm/php-fcgi server.
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
# fastcgi_intercept_errors on;
fastcgi_param PHP_VALUE "upload_max_filesize = 16M \n post_max_size=18M";
client_max_body_size 68M;
include fastcgi_params;
}
location ~ ^/(wp-admin|wp-login\.php) {
auth_basic "Welcome - Admin Restricted Content";
auth_basic_user_file /etc/nginx/.htpasswd;
}
location = /wp-login.php {
deny all;
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
include fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PHP_VALUE "upload_max_filesize = 16M \n post_max_size=18M";
client_max_body_size 68M;
}
global/restrictions.conf
# Global restrictions configuration file.
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~ /\. {
deny all;
}
location ~* /(?:uploads|files)/.*\.php$ {
deny all;
}
These all worked prior to the last update
...
Has anyone encountered such an issue?
Does anyone know how to resolve this?
Is there something in my configuration that might be causing the issue after the update
to 4.8?
Thanx
P.s. the error logs are not showing anything in particular...
Share Improve this question edited Jul 4, 2017 at 15:31 Jadeye asked Jul 4, 2017 at 14:54 JadeyeJadeye 13910 bronze badges 1 |2 Answers
Reset to default 1I've ran into that trouble before with some of my sites when I transferred them to another server.
Here's what I did. edit your apache2.conf
at /etc/apache2/
folder.
Run the following command:
nano /etc/apache2/apache2.conf
Scroll down and look for this section with a comment:
# your system is serving content from a sub-directory in /srv you must allow
# access here, or in any related virtual host.
Make sure that this is the one in there:
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride all
Require all granted
</Directory>
For short, grant it. For your permalinks not to fail.
-Dave
You might try flush_rewrite_rules( $hard );
Be sure to remove the function aftewards though.
https://codex.wordpress/Function_Reference/flush_rewrite_rules
本文标签: htaccessAfter updating to 48 permalinks will not work (all 404)
版权声明:本文标题:htaccess - After updating to 4.8 permalinks will not work (all 404) 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741985088a2408628.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
<IfModule mod_rewrite.c>
wrapper - do you get an error? You appear to employing a "WordPress" front controller in both the Nginx config file and.htaccess
? Why both? Your.htaccess
file contains an exception for403.shtml
- but this isn't referenced in the config files shown here? – MrWhite Commented Jul 22, 2017 at 21:44