如何在drupal中设置基本网址 [英] How to set the base url in drupal
本文介绍了如何在drupal中设置基本网址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我可以在哪里设置 drupal 站点的基本 URL.目前,当我在本地主机中访问该站点时,它会重定向到原始站点.请帮帮我.
Where I can set the base url for drupal site. Currently when I go to the site in my localhost, it redirects to the original site. Please help me.
我尝试在sites/default/settings.php 中设置$base_url
I have tried setting the $base_url in the sites/default/settings.php
这是我设置基本网址的部分
Here is the portion where I set the base url
/**
* Base URL (optional).
*
* If you are experiencing issues with different site domains,
* uncomment the Base URL statement below (remove the leading hash sign)
* and fill in the URL to your Drupal installation.
*
* You might also want to force users to use a given domain.
* See the .htaccess file for more information.
*
* Examples:
* $base_url = 'http://www.example.com';
* $base_url = 'http://www.example.com:8888';
* $base_url = 'http://www.example.com/drupal';
* $base_url = 'https://www.example.com:8888/drupal';
*
* It is not allowed to have a trailing slash; Drupal will add it
* for you.
*/
# $base_url = 'http://www.example.com'; // NO trailing slash!
$base_url = 'http://localhost/mysite'; // NO trailing slash!
推荐答案
通常不需要设置base_url,您只需要清除 drupal 缓存.
Usually you don't need to set base_url, you simply have to clear drupal cache.
这篇关于如何在drupal中设置基本网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文