NodeHost
Wordpress
Pricing
About us
Blog
Login
Join
Docs
/
Article
/
Redirect non WWW urls to WWW using just .htaccess
Redirect non WWW urls to WWW using just .htaccess
Post by
Anthony Lee
·
⌨️ Code Snippets
· first created 1 year ago
This is a simple rule for .htaccess to redirect all non www urls to www. ``` RewriteCond %{HTTP_HOST} !^www\\. [NC] RewriteRule ^(.*)$ <http://www>.%{HTTP_HOST}/$1 [R=301,L] ```
📁 All
💼 Organizations
🔌 API
🪧 Questions
📚 Setup Guides
📘 Panel
⌨️ Code Snippets
📙 Policies