当另一个页面受到限制时自动重定向不受限制的页面

当另一个页面受到限制时自动重定向不受限制的页面
<VirtualHost *:80>
    ServerName admin.fxmagician.com
    ServerAlias www.admin.fxmagician.com
    DocumentRoot /var/www/admin.fxmagician.com/public/

    <Directory /var/www/admin.fxmagician.com/public>
        Options All -Indexes
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

##.htaccess##
ErrorDocument 403 /restricted.php
SetEnvIf CF-Connecting-IP "^103\.111\.227\.224$" ALLOWED_IP=1
SetEnvIf CF-Connecting-IP "^146\.70\.102\.166$" ALLOWED_IP=2
Require env ALLOWED_IP

<IfModule mod_dir.c>
    DirectoryIndex admin.php
    DirectoryIndex restricted.php
</IfModule>

相关内容