Apache .htaccess directives are pretty straight forward.  The “SetEnvIf” that passes different values if the conditions are met then are processed by the standard Deny/Allow directive.  Here’s a sample from Apache’s documentation:

#allow a single uri through .htaccess password protection
SetEnvIf Request_URI "/test_uri$" test_uri

 
#allows everything if its on a certain host
SetEnvIf HOST "^test.yoursite.com" test_subdomain_url

SetEnvIf HOST "^yoursite.com" live_url

Order Deny,Allow


AuthName "Restricted Area"
AuthType Basic
AuthUserFile /path/to/your/.htpasswd
AuthGroupFile /

Require valid-user

#Allow valid-user

Deny from all
Allow from env=test_uri
Allow from env=test_subdomain_url
Allow from env=live_url
Satisfy any

This is handy in case you want to control all password protected areas of your site all in one place.  I have even added an admin interface that can add new environments to the web root’s .htaccess file on the fly.  This is a simple way to improve your web security for different sections and works great!


Say what you want about GoDaddy, but I think in the past 2 years they have really stepped up with their hosting packages.  The new cPanel is very stable, clean, and super reliable.  Adding additional sites to your host package takes 5 minutes.  Installing the latest WordPress on a site?  Done with a click of a button.

One issue you probably will encounter is the small file size restriction on  your new GoDaddy WordPress site, which defaults to a paltry 2MBs.  For shared VPN hosting, all you have to do is create a new user.ini file and save it in your webroot folder.  Here are setttings to increase file uploads to 128MBs, which is probably more than enough for most sites.  Don’t forget to also increase your file maximum timeout setting, too however, or the PHP upload script may timeout before your bigger files get uploaded, a common problem with servers.  Many inexperienced server admins make the mistake of allowing larger file sizes but they don’t increase the script execution time!

Never heard of a user.ini file?  Here’s some more details about it on GoDaddy’s website.

upload_max_filesize = 128M
post_max_size = 128M
memory_limit = 128M
max_execution_time = 600

 

Here’s a sample of what I have in one of my website’s “user.ini” file.  By the way, “user.ini” is a special GoDaddy php.ini file they use on their hosting, it may be that if you are using a different hosting package that you need to put these settings in the php.ini file.  Also, I have seen you will need to put a php.ini file in your WordPress /wp-admin folder in other hosts for WordPress to see your new file upload settings.  You may also encounter that you did everything correctly but your host will override certain settings, if you find this is the case, you may have to upgrade or change hosts to accommodate the ability to upload larger file sizes.