This was posted on 04/03/2011 and was filed in Tips And Tricks, .htaccess, How-Tos | (No Comments Yet)
I use this ALL the time, so It's nice for me to have a quick place to reference it and I figure there are others out there looking for something like this. If you want to completely remove the www. from your domain name when visitors visit your website, place the following code snippet into your .htaccess file.
RewriteCond %{HTTP_HOST} ^www.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
This is the same code that my site and my clients' sites use to remove the www from their domain name when a visitor searches. This will simply and cleanly redirect any link to your site to the non-www version. For example, http://www.maxmorgandesign.com/contact/ simply becomes http://maxmorgandesign.com/contact/. Easy, yeah?
Have I Helped You? Share Some Love!
Comments
» No Comments have been made on this. How about you start us off?
Comment On This
Browse By Category
- All Posts
- Useful Websites
- Money Savers
- Tips And Tricks
- Social Media
- Guides and Information
- PHP
- How-Tos
Latest Posts
- » PHP Unserializer
- » How To: Quickly Add a New PHP Extension Via SSH
- » Easily Open A TCP Port On Your Stock cPanel Server
- » Free Code: Find The Total Line Count Of A Folder Using PHP
- » Free Code: ReCaptcha Form Validation With PHP
- » View All
Advertising
© Max Morgan Design 2009 - 2012 | Page Generated In 0.20784 Seconds Using 42 MYSQL Queries


