Zahari M. Posted August 17, 2013 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!
teppo Posted August 17, 2013 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
Zahari M. Posted August 17, 2013 Author 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!
beto Posted December 26, 2017 Posted December 26, 2017 Thanks @teppo. For me SEO is everything. So I will use the non-www version.
Recommended Posts