Redirect to "Coming Soon" page on WordPress site

0

I'm developing a WordPress site and I did not want to be adding any "coming soon" plugins (soon) because I already have a page for that effect to replace my homepage.

What I want to know is if it is possible to redirect to this page any user who enters my site through another link.

    
asked by anonymous 15.10.2018 / 14:43

2 answers

0

Good morning Ricardo,

Have you tried putting a .htaccess to redirect?

If you have never messed with this, here is a link that can guide you: link

    
15.10.2018 / 15:26
0

There are several ways to do this in Wordpress using PHP, as shown here

//redirecionar nao-administradores
function pagina_em_breve()
{
    global $pagenow;

    if((!is_user_logged_in() || !current_user_can('manage_options')) && !is_page("login") && !is_page("em-breve") && $page_now != "wp-login.php")
    {
        wp_redirect(home_url("em-breve"));
        exit;
    }
}
add_action('template_redirect', 'pagina_em_breve');

Alternatively, you can use .htaccess to redirect every IP different from yours to that page:

Options +FollowSymlinks
RewriteEngine on
RewriteCond %{REMOTE_ADDR} !^123\.45\.67\.89$ # <-- seu IP
RewriteCond %{REQUEST_URI} !em-breve\.html
RewriteRule ^(.*)$ /em-breve.html [R=302,L] 

Do not forget to replace with your IP in !^123\.45\.67\.89$

    
21.11.2018 / 04:28