Tag Archives: computing

Restrict Access to Addon Domains

I run several websites on a single hosting plan. While some web developers do this to save money, I did this to save time. When you have all your hosted sites under one cPanel account(or in the same HTTP folder), it is easy to manage them. One problem you need to resolve is that add-on domain databases can be access through the primary domain. It can be fixed by adding a code to our good old .htaccess file in the sub-domain directory that host the files for the primary domain. The .htaccess file in each and every directory of the site must be edited(not the admin folders of CMSes) to include this code.

Make sure you add this code at the very top of the .htaccess file.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?primarydomain.com$ [NC]
RewriteCond %{REQUEST_URI} ^/addonfolder/(.*)$
RewriteRule ^(.*)$ - [L,R=404]

This will redirect the users to a 404 page on your main site… However, if you just want everything redirected from one place, you can edit the root directory of the primary site and use the following code for multiple add-ons;
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?domain.com$ [NC]
RewriteCond %{REQUEST_URI} ^/addon1/(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^/addon2/(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^/addon3/(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^/addon4/(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^/addon5/(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^/addon6/(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^/addon7/(.*)$
RewriteRule ^(.*)$ - [L,R=404]

If you add the code in the primary domain’s root .htaccess file, the code will not provide a 404 error page on your main website, but it will redirect the users to the sub-domain site.

HTTP Status Code Definitions Explained

I ran in to into Error 500 issue about a week ago as soon as I tried to edit the .htaccess file on the server. I was blindsided because I had no clue what Error 500 stand for and the hosting service support team was useless because they told me that my name servers are out of order. After 24 hours wait time for DNS propagation, the site was still off line. So I decided to do my own little investigation. What I found was that Error 500 is caused by a programming error I made on the .htaccess file! I went to Continue reading HTTP Status Code Definitions Explained

Deleting files over a network

I just ran in to a huge problem. I accidentally deleted a documentary file over the network. The network drive was mapped to my computer and the folder was located on the server hard drives. No matter what back up I had, I deleted the entire documentary by mistake on the network drive and now I can’t find it anyway. This is a huge overlook that still we face in share folders in Microsoft Windows environment. I don’t know Continue reading Deleting files over a network

How to delete a Remote Desktop Connection entry

I found that most people have no idea how to delete a cached entries from Remote Desktop Connection (RDC) on a Windows OS based computer. In fact, I had no clue how to do this up until recently I had to log in to my server from a public school computer to modify some files. Even after you log out and select delete profile from the RDC, it will still show up in the Connections drop down next time someone open it. This is a problem because if a user with wrong intent to attack your computer or server open the RDC, it will provide them with half of the solution to hack your system, the IP or domain name!

If you try Google search to find an answer to this issue, you will quickly come across Microsoft KB article here, which is more complicated than useful to most users. I have no idea why a great user friendly software company like Microsoft doesn’t explain well on their help sites on registry editing for intermediate to advance users. May be because they don’t want novice users to pick up that information from their site and damage the OS in the process of regedit. Yes, it include the path and how to edit it, but there are no clear cut step by step instructions on how to properly do it.

The following method is the easiestway to delete an entry from Remote Continue reading How to delete a Remote Desktop Connection entry

Thank you for the suggestions to improve the blog

Most web developers don’t take suggestions from the public seriously. But I do care about your input to my website and the blog.

Recently few of my visitors suggested great ways to improve social media integration to promote this blog through comments, “Likes”, emails forwards, etc. As you may have noticed already, I went ahead and added the Facebook module and Share/Bookmark module to my WP blog. The Facebook Like/Send module will only appear when you click on the article link itself.

Anyway, please keep these great suggestions for improvement coming. I do read all of them and I will implement most of the interesting modules.

Special thanks goes to visitor named “Treadmill reviews” for Facebook suggestion.

Side note: This is my first blog post using Blackberry Bold 9900 WordPress Application.