Txt

Byte sized tech know-how.

  • Home
  • About

Tag Archives: mod_rewrite

06 Sep

Remove www From URL using .htaccess in Apache

This htaccess code will remove the ‘www’ part from the url. It uses the mod_rewrite module of apache to re-write the url – so make sure that’s installed.


RewriteEngine On 
RewriteCond %{HTTP_HOST} ^www.domain.com[NC]
RewriteRule ^(.*) http://domain.com/$1 [R=301,L]
admin Posted in Code apache, Code, htaccess, mod_rewrite, remove, www 5 Comments

Post navigation

Categories

  • Code
  • Command Line
  • Configuration
  • CSS
  • HTML
  • internet
  • JavaScript
  • Linux
  • Mobile
  • Perl
  • PHP
  • Python
  • Ruby
  • Uncategorized

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
Fruitful theme by fruitfulcode Powered by: WordPress
↑