Posts Tagged With: htaccess

Remove www From URL using .htaccess in Apache

Tagged with: , , , , ,

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]
2 Comments »

Compress PHP Output from .htaccess

Tagged with: , , ,

Compress all PHP output by adding this line to .htaccess file


php_value output_handler ob_gzhandler 

No Comments »