.htaccess fun

This website:

http://tips-scripts.com/undefined

Is fucking awesome. I’ve been melting my brain trying to figure out if it’s possible to strip off nonexisting subdomains, and couldn’t get my head around it for the life of me… Turns out the .htaccess file comes in to save the day… again.
I came across this:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(.+)\.([^\.]+\.[^\.]+)$
RewriteCond %1 !^(www)$
RewriteCond %{HTTP_HOST} !^[0-9\.]+$
RewriteRule ^(.*)$ http://%2/$1 [R,L]

And had to repost it just because of it’s pure usefulness, and perhaps it will help someone else out with the same problem.

Not only that but here’s more:
Mod Rewrite Guide
URL Masking
Rewrites

Yet again the simplest solution is always the best… I wish I where more simple-minded.

For Spiders:
truncate subdomain remove subdomain from domain name htaccess subdomain

And something completely random…
If you’re looking to make a little (or a lot of) money on the side, keep an eye on the following:
http://pleaserobme.com/