11 February, 2023 seen 650
Nginx (pronounced "engine x") is a high-performance web server and reverse proxy server. It is a free and open-source…
It has been years since I last time used .htaccess file available in Apache. I'm using Ngnix servers for 99.9 of mine work.
But today I had an opportunity to work on Apache environment, which uses .htaccess file.
So in order to rewrite non www to www in Apache I added following rulles to .htaccess file:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
For Ngnix please read this article: