Prevent browsing subdomain from primary domain

  • Author
    Posts
  • #1075425

    kaydaych
    Member

    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:
    mydomain.co.uk
    and I want to prevent a user browsing to 2 sub domains
    mydomain.co.uk/subdomaina
    mydomain.co.uk/subdomainb

    Heres my htaccess file:
    rewriteengine on

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteBase /

    </IfModule>
    # 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 :)

    #1075525

    supportbot
    Member

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

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

    If you don’t understand the difference between WordPress.com and WordPress.org, 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.