Php Linux Apache2 Wordpress核心位于子目录中,但没有重定向到wp admin
我当前的Wordpress安装位于Php Linux Apache2 Wordpress核心位于子目录中,但没有重定向到wp admin,php,wordpress,apache,.htaccess,Php,Wordpress,Apache,.htaccess,我当前的Wordpress安装位于/var/www/html/mydomain.tld/cms/,我的WP\u站点URL设置为https://mydomain.tld/cms和WP_HOME tohttps://mydomain.tld在wp-config.php中 在/var/www/html/mydomain.tld/index.php中,我有require(dirname(_文件).'/cms/wp blog header.php') /var/www/html/mydomain.tld/
/var/www/html/mydomain.tld/cms/
,我的WP\u站点URL设置为https://mydomain.tld/cms
和WP_HOME tohttps://mydomain.tld
在wp-config.php中
在/var/www/html/mydomain.tld/index.php
中,我有require(dirname(_文件).'/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
#开始WordPress
重新启动发动机
重写基/
重写规则^index\.php$-[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则/index.php[L]
#结束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。但现在它返回一个302,指向https://mydomain.tld/cms/wp-admin
有效地将攻击者重定向到正确的位置
我如何配置我的wordpress和/或Apache2以达到预期的效果?如果您有mod_alias,您可以
重定向404/wp管理/
就像在那个url上抛出404一样
取自
我还没有尝试过。添加重定向404/wp admin
和重定向404/wp login.php
到.htaccess的结尾,该站点运行正常!非常感谢你。