.htaccess Remove WWW from URL + Directories
snippet in htaccess

.htaccess Remove WWW from URL + Directories

user9530

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1%{REQUEST_URI} [R=301,QSA,NC,L]

.htaccess Remove WWW from URL + Directories

user7722

# force non-www domain
RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
RewriteRule (.*) http://example.com/$1 [R=301,L]