不重定向使用.htaccess中的子域不重、htaccess

2023-09-02 01:08:32 作者:宁愿孤独不要虚情

我的网站,使用Word preSS和我平时登录为:mydomain.com/wp-admin。我想这是对的子域。 我曾尝试使用以下重写URL来创建一个子域:

I have site which uses wordpress and I usually login as : mydomain.com/wp-admin . I want it to be on the subdomain . I have tried to create a subdomain by using the following rewrite url :

RewriteCond %{HTTP_HOST} ^wp-admin
RewriteCond %{REQUEST_URI} !^/wp-admin
RewriteRule ^(.*)$ wp-admin/$1 [L]

但是,当我试图达到 http://wp-admin.mydomain.com/ A weired页面出来说的错误消息:

But when I am trying to reachhttp://wp-admin.mydomain.com/ a weired page comes out saying an error message :

如果你觉得你已经达到这页错误,请与网站的所有者:

和URL更改为:

http://wp-admin.mydomain.com/cgi-sys/defaultwebpage.cgi

请帮我怎么可能能够创建一个子域。

Please help how could I be able to create a subdomain .

推荐答案

您可以尝试给出一个绝对路径,并执行内部重定向(又名直通)。

You could try to give an absolute path, and to enforce an internal redirect (aka. pass-through).

RewriteRule ^(.*)$ /wp-admin/$1 [PT,L]
                   ^             ^^