简体   繁体   English

.htaccess重定向不起作用

[英].htaccess redirect doesn't work

guys! 伙计们! Can anyone help me with Redirect via .htaccess? 谁能帮助我通过.htaccess进行重定向? Why the following code doesn't work? 为什么以下代码不起作用?

Redirect http://website/admin.php http://website/login.php

Web-server: apache, running on a local PC. Web服务器:Apache,在本地PC上运行。

Thank you in advance. 先感谢您。

You do not need to put the host in the request part. 您无需将主机放入请求部分。 Just use /admin.php : 只需使用/admin.php

Redirect /admin.php http://example.com/login.php

or, to make it permanent: 或者,使其永久不变:

Redirect 301 /admin.php http://example.com/login.php

See this for more information: 301 Redirects 有关更多信息,请参见此301重定向

尝试这个 :

Redirect 301 /admin.php http://website/login.php

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM