Redirect www to non-www

I personally prefer the non-www domain to the www.* sub domain which evolved from the traditional web beginnings. Here is a generic .htaccess redirect from www.domain.tld to domain.tld.

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [L,R=301]

Related Posts

Extending colorbox.js

Colorbox is a very flexible lightbox plugin for jQuery which I have used for 2 to 3 years now and found virtually no limitations to what I’ve wanted to do with it. I’ve used it for many things like simple image previews, custom image cropping, image file uploads, as well as custom product checkout processes.

Read More

Useful log files

We have a simple API where I work that isn’t anything impressive, it is just a couple of scripts that accept POST and GET requests. However the previous developer who worked on it hadn’t considered the total ramifications and logged all requests using an email with print statements. Additionally, for each request there could be up to 3 emails generated, one for the initial request, one for errors, and one that included the payment gateway request and response. Not mention it definitely breaks PCI Compliance by emailing people’s credit card information, but we were also experiencing load issues on the web server for all the emails that were being generated through PHP Send Mail and the end result is about 10,000 to 100,000 emails waiting in my email account.

Read More

Hello World!

Hello fellow webbers! It feels good to finally have some web space where I can get my geek on.

Read More