最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

url rewriting - Cannot access wp-admin without trailing slash - .htaccess configuration for Wordpress behind a nginx proxy

programmeradmin0浏览0评论

I have a WordPress instance running via http-proxy-middleware, so I can have my WordPress blog under example/blog

The problem I'm struggling with is I cannot configure the .htaccess file properly.

Here's my config:

<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>

By default, WordPress generates all links without the trailing slash.

I can access the following:

example/blog/wp-login.php

example/blog/wp-admin/

example/blog/wp-admin/index.php

But when I go to example/blog/wp-admin (no trailing slash) the redirection fails.

Same happens when I manually add the trailing slash to a post link:

example/blog/testing works

example/blog/testing/ fails

I wonder if I should focus on the http-proxy-middleware configuration or could it be that my .htaccess file is configured incorrectly?

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论