使用htaccess将页面重定向到登录页面

时间:2015-09-09 08:53:05

标签: php wordpress

1 个答案:

答案 0 :(得分:1)

您可以在htaccess文件中添加以下代码。这可能会对你有帮助。

# 301 --- http://demo.pageinvasion.com/?pg_track=request_demo&un=demo => http://demo.pageinvasion.com/wp-login.php
RewriteCond %{QUERY_STRING} (^|&)pg_track=request_demo($|&)
RewriteCond %{QUERY_STRING} (^|&)un=demo($|&)
RewriteRule ^$ /wp-login.php? [L,R=301]

# 301 --- http://demo.pageinvasion.com/ => http://demo.pageinvasion.com/wp-login.php
RewriteRule ^$ /wp-login.php? [L,R=301]