admin管理员组文章数量:1122832
I've a problem with a site (part of a multisite structure).
All of a sudden all the static pages are showing the list with the last posts, except for the homepage. The single posts are working fine.
If I change the permalinks from "post name" to "plain" everything is working fine. here the htaccess file.
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{ENV:REDIRECT_STATUS} 200 [OR]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
what could it be? Any hint? thank you
I've a problem with a site (part of a multisite structure).
All of a sudden all the static pages are showing the list with the last posts, except for the homepage. The single posts are working fine.
If I change the permalinks from "post name" to "plain" everything is working fine. here the htaccess file.
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{ENV:REDIRECT_STATUS} 200 [OR]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
what could it be? Any hint? thank you
Share Improve this question asked Jun 8, 2021 at 19:43 DandeDande 351 silver badge8 bronze badges2 Answers
Reset to default 0My use:
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
# BEGIN WordPress
# As diretrizes (linhas) entre "BEGIN WordPress" e "END WordPress" são
# geradas dinamicamente e só devem ser modificadas através de filtros do WordPress.
# Quaisquer alterações nas diretivas entre esses marcadores serão sobrescritas.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
I know this is an old post but I faced the same problem and did not find the correct answer anywhere. This is not a problem with the .htaccess file or permissions to the folder structure. The problem is moving wordpress sites out of the default document root folder.
If you have multiple wordpress sites or a single site in a sub-folder of your document root folder, you have to "relax access to content" for each sub-folder in the apache2.conf or the httpd.conf files.
When this is added you will be able to use "Pretty Permalinks" instead of the almost pretty or plain permalinks.
/etc/apache2/apache2.conf
/etc/httpd/conf/httpd.conf
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
# Added
<Directory /var/www/html/site1/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/html/site2/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
# End added
本文标签: htaccessOnly plain permalinks working
版权声明:本文标题:htaccess - Only plain permalinks working 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736282635a1926705.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论