![](/img/trans.png)
[英]wordpress redirect loop in wp-admin (apache compiled from source)
[英]Linux Apache2 Wordpress core in subdirectory but no redirect to wp-admin
我当前的Wordpress安装位于/var/www/html/mydomain.tld/cms/
,我的https://mydomain.tld
在wp-config中设置为https://mydomain.tld/cms
而WP_HOME设置为https://mydomain.tld/cms
.php。
在/var/www/html/mydomain.tld/index.php
我require( dirname( __FILE__ ) . '/cms/wp-blog-header.php' );
。
/var/www/html/mydomain.tld/.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
/var/www/html/mydomain.tld/.htaccess
为空。
我的永久链接设置为“日期和名称”: https://mydomain.tld/2018/06/02/sample-post/
。
目前的行为是我可以浏览使用https://mydomain.tld
和页面,如https://mydomain.tld/about
工作没有任何问题。
问题是我将wordpress安装放在一个子目录中,以确保https://mydomain.tld/wp-admin
将返回404。但是现在它返回一个指向https://mydomain.tld/cms/wp-admin
的302。 https://mydomain.tld/cms/wp-admin
有效地将任何攻击者重定向到正确的位置。
如何配置wordpress和/或Apache2以使其符合预期的行为?
如果您有mod_alias,则可以
重定向404 / wp-admin /
就像在该网址上抛出404一样
取自https://webmasters.stackexchange.com/questions/42822/how-to-redirect-specific-url-to-404-in-htaccess
我还没有尝试过。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.