Force Non-WWW

Knowledge Base Entry: #141
^Top
<< Back
Mobile-Menu










Force Non-WWW
Category: Apache2/HTAccess
Author: Bugfish
Created at: 2021-08-01 07:59:02
Modified at: 2025-09-19 17:27:25
Directs Hits: 458

This is the code for an .htaccess file which does redirect all www requests to non-www requests

RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
Caution: I do not guarantee the reliability of the information given here, the code described on this page is executed at your own risk and in the event of damage or other unforeseeable consequences I am in no way responsible or liable.
This Website is using Session Cookies for Site Functionality.