Skip to:
Content
Pages
Categories
Search
Top
Bottom

redirect all non existing subdomains to the custom register page

  • I’m looking for a solution to redirect all non existing subdomain to the custom register page when registration is enabled.

    Is there someone who can give me a htaccess example for this or is there a other solution?

Viewing 3 replies - 1 through 3 (of 3 total)

  • Eric Wood
    Participant

    @moonviper

    On my sites, I simply have a 404 file in my themes which is actually a redirect to where ever I’d like it to go:

    <?php

    // Permanent redirection

    header(“HTTP/1.1 301 Moved Permanently”);

    header(“Location: http://yourdomain.com&#8221;);

    exit();

    ?>

    Simply copy and paste the above into your 404.php file for your theme, and you’re set!

    This is what i’m looking for:

    If a subdomain example.domain.com doesn’t exist it forwards to domain.com/register

    But if example.domain.com/ exist and a post like example.domain.com/2009/02/15/some-post-title/ is deleted it forwards back to example.domain.com/

    Could someone help me with this?


    Frumph
    Participant

    @frumph

    What does this do in the wp-config.php then?

    define( ‘NOBLOGREDIRECT’, ‘http://yourdomain.tld/&#8217; );

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘redirect all non existing subdomains to the custom register page’ is closed to new replies.
Skip to toolbar