Prevent browsing subdomain from primary domain

  • Author
  • #1075425


    Hello all. Ive searched everywhere for a way to do this but every time I add a block of text to the htaccess file I get a 500 error.

    I have a primary domain as example:
    and I want to prevent a user browsing to 2 sub domains

    Heres my htaccess file:
    rewriteengine on

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteBase /

    # END WordPress
    rewriterule ^index\.php$ - [L]
    rewritecond %{REQUEST_FILENAME} !-f
    rewritecond %{REQUEST_FILENAME} !-d
    rewriterule . /index.php [L]
    rewriterule ^index\.php$ - [L]
    rewritecond %{REQUEST_FILENAME} !-f
    rewritecond %{REQUEST_FILENAME} !-d
    rewriterule . /index.php [L]

    How would I add allow/deny or rewrite conditions to the above to prevent loading the 2 sub domains?

    Thanks for any help you can offer :)



    You did not specify a blog address or reason for posting when you created this topic.

    This support forum is for blogs hosted at If your question is about a self-hosted WordPress blog then you’ll find help at the forums.

    If you don’t understand the difference between and, you may find this information helpful.

    If you forgot to include a link to your blog, you can reply and include it below. It’ll help people to answer your question.

    This is an automated message.

The topic ‘Prevent browsing subdomain from primary domain’ is closed to new replies.