WP Hive » Troubleshooting and How-To

How to restrict blog setup

(8 posts)

  1. rkennel
    Member

    I have several blogs set up using wp-hive. My problem is that anyone can create a subdomain and install a blog on my server by typing in anything.mydomain.com. Even though it is not a valid subdomain, the 5-minute install page comes up and anyone can create a blog.
    How do I restrict access so that this does not happen? I don't want people creating blogs on my site. Is this a security hole that I left open?

    Thanks,
    Rebecca

    Posted 3 years ago #
  2. deuts
    Member

    You can just simply disable the DNS wildcard if you have any for your subdomains.

    Posted 3 years ago #
  3. rkennel
    Member

    Thanks deuts,

    I asked my host to disable the DNS wildcard and now none of my subdomains work. What is happening? I want to be able to create subdomains for multiple blogs, but I don't want just anyone creating blogs on my site. What am I missing here??

    RK

    Posted 3 years ago #
  4. deuts
    Member

    You can add subdomains individually from the control panel.

    Posted 3 years ago #
  5. rkennel
    Member

    When the DNS wildcard is disabled, even the subdomains that I had created using the control panel will return the 'file not found' error.

    This is what my server support says:
    "Your subdomains don't work because you asked us to disable your wildcard DNS entry. I have now re-added it. The best way to deal with this issue is to find a fix within wordpress itself."

    Has no one else had this problem?
    Would it be a configuration on the server side or something within my configuration?

    Thanks,
    RK

    Posted 3 years ago #
  6. ikailo
    Developer

    In the database table wphive_config, set the val column for the item allow_new_hosts to 0.

    Here's the SQL Query:
    UPDATE wphive_config SET val=0 WHERE item='allow_new_hosts'

    I actually recommend this be done for all installations, unless you are in the process of adding a new site to the hive.

    Posted 3 years ago #
  7. rkennel
    Member

    I tried to put in the SQL Query and received the following error:

    #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UPDATE wphive_config SET val=0 WHERE
    item='allow_new_hosts' LI

    I am using phpmyadmin and I don't understand it. . .

    Thanks for this!
    RK

    Posted 3 years ago #
  8. pkonink
    Member

    I have this same sort of setup. I'm using Cpanel shared hosting with addon domains. So if I add domain xxx.com with username xxxuser, you can access it both with xxx.com and xxxuser.main-domain.com.

    The way I handle this is through a .htaccess file. Since I am using wp-hive, I use the .htaccess file in my base wordpress directory (in my case I have it in main-domain.com/wp_base/) which is where all the hive sites point.

    I add the following lines:

    RewriteCond %{HTTP_HOST} ^xxxuser\.main-domain\.com$
    RewriteRule ^(.*)$ http://xxx.com/$1 [R=301,L]

    Save, close and that should do it. Add a modified copy of that pair in the same .htaccess file for each other domain.

    Posted 3 years ago #

RSS feed for this topic

Reply

You must log in to post.