Zahari M. Posted August 17, 2013 Share Posted August 17, 2013 Hi Guys! Not very good with htaccess files hence the question... The standard PW .htaccess file gives us the option to redirect non www to www... # ----------------------------------------------------------------------------------------------- # Optional: Redirect users to the 'www.' version of the site (uncomment to enable). # For example: http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] How would we do the opposite? Cheers guys! Link to comment Share on other sites More sharing options...
teppo Posted August 17, 2013 Share Posted August 17, 2013 RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] RewriteRule ^(.*)$ http://%1/$1 [R=301,L] Just for the record, you might want to consider the benefits of using www-subdomain before doing this, though. 6 Link to comment Share on other sites More sharing options...
Zahari M. Posted August 17, 2013 Author Share Posted August 17, 2013 Hey teppo Many thanks for that! That's a good link you put there! I guess I shall stick to www this time round... But I will also add your code into the htaccess comments file for future needs Teppo... Thanks mate! Link to comment Share on other sites More sharing options...
beto Posted December 26, 2017 Share Posted December 26, 2017 Thanks @teppo. For me SEO is everything. So I will use the non-www version. Link to comment Share on other sites More sharing options...
Recommended Posts