Trusted host setting for XAMPP Server
To enable the trusted host setting, we need to enable our hosts in $settings['trusted_host_patterns'].
Open the "settings.php" file and update the below code to enable the trusted host setting:
$settings['trusted_host_patterns'] = [
'^localhost$',
'^192\.151\.3\.101$',
'^127\.0\.0\.1$',
];
Here,
'^localhost$',: This will allow the site to only run from localhost.
'^192\.151\.3\.101$', : This will allow the site to only run from system IP
'^127\.0\.0\.1$', : This will allow the site to only run from 127.0.0.1 instead of localhost.
Note: When we are running multisite then we will define all host patterns that are allowed by the site.
Comments
Post a Comment