Skip to main content

Post categories

  • Drupal Tips & Tricks
  • Drupal HowTos
  • Drupal Tutorials
  • Drupal Modules
  • Drupal Themes
  • twitter
  • youtube
Home
Drupal 4U
Drupal Development, Drupal Web Design, Drupal SEO
  • Home
  • Showcases
  • Services
  • Blog
  • Themes
  • Modules
  • About
  • Contact

Breadcrumb

  1. Home
  2. Tutorials
  3. Drupal Trusted Host Settings

Drupal Trusted Host Settings

Tutorials
July 05, 2020
Profile picture for user drupal
By drupal
  • facebook-f
  • twitter
  • envelope
  • print
82

As of January 2015, Drupal supports "trusted host patterns", where you can (and should) specify a set of regular expressions that the domains on incoming requests must match. Example configuration in settings.php would read:

$settings['trusted_host_patterns'] = array(
'^www\.example\.co.uk$',
'^example\.co.uk$',
);

See the above change record for more details. Note that, if you're doing local development, you might get (temporarily) locked out of your site by the above configuration on its own. You should add a trusted host pattern for '^localhost$' in this case.

See also: https://www.drupal.org/node/1992030

Configuration

Read more articles

Newer
How to enable Superfish menu in Danland/Danblog theme?
Older
Learnings 4 Drupal Developers: WHIPLASH-How to Survive Our Faster Future
  • Log in to post comments
Profile picture for user drupal
drupal
82
1
min read
A- A+
  • facebook-f
  • twitter
  • envelope
  • print

Contact Drupal 4U

Get in touch for questions and our Drupal development, design and SEO services.

Contact Us

We aim to reply the latest within 48h.

About Drupal 4U

We are a group of Drupal designers, developers and webmasters and we launched this website to share our experience and knowledge with you. Drupal is a free software package that allows you to easily organize, manage and publish your content, with an endless variety of customization. Drupal is open source software maintained and developed by a very large community of developers and users.

  • twitter
  • youtube

Drupal Services

  • Drupal Web Design
  • Drupal Development
  • Drupal SEO
  • Drupal Migration

Drupal Insights

  • Drupal Tips & Tricks
  • Drupal HowTos
  • Drupal Tutorials
  • Drupal Modules
  • Drupal Themes

Drupal Blog

  • Configuration
  • Content
  • Installation
  • Menus
  • Modules
  • Optimisation
  • Taxonomy
  • Themes
  • Troubleshooting
  • Views

Drupal 4U

  • Services
  • Blog
  • About

Drupal Links

  • Official Drupal Website
  • Drupal Answers
  • More Than Themes
  • Theme Forest
  • DXPR: Drupal for Marketers
2012 - 2023, Drupal 4U

Footer menu

  • Contact
Home
Drupal 4U
Drupal Development, Drupal Web Design, Drupal SEO
  • Home
  • Showcases
  • Services
  • Blog
  • Themes
  • Modules
  • About
  • Contact
Clear keys input element