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)
  • Avatar of Moonviper
    moonviper
    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“);

    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?

    Avatar of Frumph
    Frumph
    Participant

    @frumph

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

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

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

You must be logged in to reply to this topic.