The thing in question this time is this site. Between a unusually high spam volume and some misbehaving scripts I had decided it was time to change some stuff on the server. At least this time I did back up my database and some key files so I still have all the old content, some key files, and
pictures. I may put it back like it was or just start over I haven't decided. I am slowly putting things back together and actually compared to most of the time I spend on computers these days this sort of made for a nice diversion. Looking at some of my files I noticed that I've accumulated quite a few trivial web tricks over time. For instance whether a person types www.mollyleadrive.org or mollyleadrive.org in their address bar they will see the latter. Not a big deal really and the idea came from
these guys originally as far as I know and is really just a few lines in a
.htaccess file with the help of
mod_rewrite.
...all of the traffic to http://www.yourdomain.com is politely and silently redirected to http://yourdomain.com. This is currently the preferred no-www classification as it does not inconvenience your users, but it does assert the deprecated nature of the www subdomain.
The process of making your domain a Class B is quite simple. All you need to do is create or modify a file called .htaccess located in the root directory of your site and add the following lines, changing the red text to match your domain.
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.domain\.com$ [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L]
Then I have this
bit of code pasted in the head of my page that opens all offsite links in a new window using JavaScript. Someone deserves credit for this one but I honestly do not remember where I found it. Then there is hotlinking images not that I think I really care I just don't do it out of respect courtesy that sort of thing. However once on another site I had
this picture up around Halloween and the children on
MySpace had it hotlinked all over the place so I decided to put some protection in place. In those days I was squatting on a DSL connection that specifically had no servers of any kind in their terms of service and this picture was getting called up thousands of times a day at one point.
This article makes the most sense of any advice I've seen on the subject of hotlinking. Again however the amazing
Apache Server is needed, as well as
PHP though to pull it off.
Of course as time goes on the complexity of the website changes, scripts and programs get updated, and if one is not very careful (latest stable release are three words I should pay heed to more often) things can go terribly wrong. In my case give me a minute and I can break anything. Then again playing with computers is how I "sort of" relax and these little glitches from time to time are just part of the learning curve for me. This time at least I did at back everything up first so it's not like I had to start from scratch. In other areas of my life I did just recently go to Japan (well actually got back about a month ago from a two week trip) for some training with my job which was very cool and I'll deal with that in another post.