网络营销电子商务研究中心  
How to buy the best prescription safety glasses in Canada? Let's study!
Go Back   网络营销电子商务研究中心 > 网站建设 > Drupal
User Name
Password
 
FAQ Members List Calendar Cheap Glasses

Reply
 
Thread Tools Display Modes
  #1   IP: 114.238.118.15
Old 2015-12-03, 02:31 PM
Oak Forest Oak Forest is offline
初级会员
 
Join Date: 2011-06-01
Posts: 1
Oak Forest 现在声名狼藉
Default Drupal 8 New setting for trusted hostname configuration

Description:



It is possible to spoof the HTTP Host header for nefarious purposes, and trick Drupal into using a different domain name in several subsystems (particularly link generation). The Symfony framework provides a trusted host mechanism, where site administrators can whitelist hostnames. This mechanism can now be configured through settings.php.

$settings['trusted_host_patterns']

$settings['trusted_host_patterns'] should be an array of regular expression patterns, without delimiters, representing the hosts you would like to allow.

Examples

If a site is run off of a single, canonical domain, then

Code:
$settings['trusted_host_patterns'] = array(
  '^www\.example\.com$',
);
will allow the site to only run from www.example.com. If you need to run a site off of multiple domains, and are not doing canonical URL redirection, then

Code:
$settings['trusted_host_patterns'] = array(
  '^example\.com$',
  '^.+\.example\.com$',
  '^example\.org',
  '^.+\.example\.org',
);
will allow the site to run off of all variants of example.com and example.org, with all subdomains included.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 3 (0 members and 3 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a Custom Home Page in Drupal Using Views Aiken Drupal 0 2015-09-14 03:53 PM
How to update drupal core topvip Drupal 0 2012-08-22 11:17 PM
免费drupal培训视频教程,justin 作品 car Drupal 1 2009-10-12 04:36 PM
新一篇: Drupal专业开发指南 作者和审稿人 car Drupal 1 2008-05-05 12:25 AM
Drupal宝典之定制篇 topvip Blog(博客)/Wiki(维客)/RSS/Cms 0 2007-06-06 08:15 AM

Prescription-glasses.com offers prescription glasses online at discount prices.
All times are GMT +8. The time now is 09:00 AM.


Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.