I’ve been making some changes under the hood here that affect my entire domain and subdomains. Let me tell you about the two changes I’ve made recently.
Blocking Spam IP Adresses
The biggest change is one that shouldn’t affect anyone without malicious intent: I’ve been blocking spam IP addresses without giving second chances. I recently found out that my host (PowWeb) makes it very easy to do so (I don’t even have to edit my .htaccess file myself–they have an interface that does it for me), so I have been blocking every offending IP address. I’m looking forward to seeing whether the number of spam comments decreases or not.
So what does this mean for the serious user? Nothing. Well, it shouldn’t have any effect on you. But if, one day out of the blue, you are unable to see my website, then you should email me.
Just a reminder: In order to protect the integrity of my blog, I have WordPress set to require my approval the first time someone leaves a comment, if it contains a certain number of links, or if it contains certain undesirable words. That means that even if you do have a previously approved comment, your comments might occasionally get held back for moderation and might not show up on the post right away. Don’t let that stop you from sharing links! That requirement is there to stop link spammers, not real users!
Thanks to Mat Packer and a couple commenters, I have now created “vanity URLs” for many of the Social Media Networking sites (SoMeNet) I use that you, dear reader, might want to have access to easily. Sites like my Facebook profile, online photo album, video uploads, and bookmarks.
I’m not doing this out of vanity, actually, but more because it was so simple to do and because I advocate more domain owners doing the same thing. I want to be an example. So let me tell you the two ways you can do this yourself if you own your own domain.
Each webmaster has to choose whether to use vanity subdomains or subfolders. You might choose to use vanity subdomains if you already use subdomains for other purposes, like http://blog.yourdomain.com. Here are the steps for setting up a 301 redirect for a subdomain.
- Set up the subdomain you want. For example, http://facebook.yourdomain.com. This can be a complicated process, so be sure to check with your host’s documentation for help if you haven’t done it before.
- Edit or create the .htaccess file for that subdomain. Add the lines below labeled “Redirect Subdomain Code.”
- Save the .htaccess file and you’re set!
Redirect Subdomain Code
# This allows you to redirect your entire website to any other domain
Redirect 301 / http://www.facebook.com/profile.php?YOUR-ID-HERE
Be sure to use your own Facebook profile URL! Just log in, click on “Profile”, and copy. To add other subdomains/redirects, simply copy the second line of code for each additional SoMeNet site.
This is the option I chose to use because I don’t use the “www” before my URL (that is, I always give out this URL: http://LindenAMueller.com/blog/, instead of this one: http://www.LindenAMueller.com/blog/), so using subfolders for my easy-to-remember SoMeNet links seemed the natural choice. Here’s how to do this, thanks to the original commenter, chrispugh, on Mat Packer’s post.
- Create the subfolder you want, for example, http://YourDomain.com/facebook.
- Edit your .htaccess file. Note: Unlike when you create a subdomain above, you should not have to create a new .htaccess file for this process. There should already be one if you have used your site at all. Add the lines below labeled “Redirect Subfolder Code.”
- Save your .htaccess file.
Redirect Subfolder Code
# This allows you to redirect a subfolder to any other domain
Redirect /facebook http://www.facebook.com/profile.php?YOUR-ID-HERE
Be sure to use your own Facebook profile URL! Just log in, click on “Profile”, and copy. To add other subfolders/redirects, simply copy the second line of code for each additional SoMeNet site.
Note: The only problem with this method is that the subfolders are case-sensitive. That means if you try this URL — http://LindenAMueller.com/Facebook — you will get an error. (Go ahead, click on it and see!) Your domain is not case-sensitive, but the subfolders are. (Thanks to another commenter on Mat Packer’s post!)
Rinse, Wash, Repeat
Once you’ve set this up for Facebook, you can then set up as many subdomains/subfolders as you want for whichever SoMeNet sites you want. Here are the ones I’ve set up.
http://LindenAMueller.com/facebook — Facebook profile (obviously, eh?)
http://LindenAMueller.com/twitter — Twitter profile (another obvious one)
http://LindenAMueller.com/flickr — Flickr photostream (for more artistic photos. And iPod Touch screen caps :) )
http://LindenAMueller.com/photos — for personal photos uploaded to Picasa
http://LindenAMueller.com/videos — for personal videos uploaded to Vimeo
http://LindenAMueller.com/diigo — Diigo, my online bookmarks
Now, those of you familiar with Twitter might wonder why I set up a subfolder redirect which is significantly longer than my actual Twitter URL, which is http://twitter.com/xgravity23. Here is my reasoning: I know my username, but other people who might want to check up on my tweets might not remember it. With these redirects, all they have to remember or bookmark is my URL (dead simple to remember, since it’s my name) and the service of mine they want to check on.