Need help? Check out our Support site, then


Prevent browsing subdomain from primary domain

  1. 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</p> <p># BEGIN WordPress<br /> <IfModule mod_rewrite.c><br /> RewriteBase /</p> <p></IfModule><br /> # END WordPress<br /> rewriterule ^index\.php$ - [L]<br /> rewritecond %{REQUEST_FILENAME} !-f<br /> rewritecond %{REQUEST_FILENAME} !-d<br /> rewriterule . /index.php [L]<br /> rewriterule ^index\.php$ - [L]<br /> rewritecond %{REQUEST_FILENAME} !-f<br /> rewritecond %{REQUEST_FILENAME} !-d<br /> rewriterule . /index.php [L]<br />

    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 :)

  2. 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.

Topic Closed

This topic has been closed to new replies.

About this Topic