Here’s a handy tip, if you want to remove the www. from your domain and have visitors always see http://mydomain.com, then all you have to do is add 4 lines of code to your .htaccess file (or create a .htaccess file if you dont have one already). Just add:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^mydomain.com$ [NC]
RewriteRule ^(.*)$ http://mydomain.com/$1 [L,R=301]
Just replace “mydomain” with the name of your domain and you’re done. Thats it! Now any time someone goes to www.mydomain.com the www. will be automatically dropped. The one caveat, your server has to be running the apache webserver for this to work. If you’re on a linux host, you proabably run apache webserver and are good to go.
By Tim Dupree at 5:10 pm on February 1st, 2009
Tags: .htaccess, apache, domains, mod_rewrite
Topics: Coding, Useful Stuff | No Comments »
After needing to get my external IP address a bunch of times when setting up long distance LAN games with my brother I made a simple page for displaying it. This link simply gives you your external IP address and nothing else, no adds or other junk like every other IP address site on the net.

*note that this is the external IP address of your cable modem and/or your router, not the local IP address of your computer on your personal network. Interested in the code? It’s from the getenv() man page at php.net. Get it here. Learn about it here.
By Tim Dupree at 9:01 pm on May 19th, 2008
Tags: IP address
Topics: Useful Stuff | No Comments »