【发布时间】:2013-02-12 22:59:31
【问题描述】:
我正在开发一个 Drupal 网站,我想在其中将我的网站显示为 www.ex.com 而不是 ex.com/drupal
我已尝试使用此代码:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^202.158.43.33$ [NC]
RewriteRule .* 202.158.43.33 [L,R=301]
RewriteRule ^$ drupal/index.php [L]
RewriteCond %{DOCUMENT_ROOT}/drupal%{REQUEST_URI} -f
RewriteRule .* drupal/$0 [L]
RewriteCond %{REQUEST_FILENAME} ! -f
RewriteCond %{REQUEST_FILENAME} ! -d
RewriteRule .* drupal/index.php?q=$0 [QSA]
</IfModule>
它保存在根文件夹中,我更改了 $base_url = 'http://www.ex.com';在 drupal/sites/default/settings.php
当我运行我的网站时,我看到的网址是:202.158.43.33/202.158.43.33/202.158.43.33/202.158.43.33.........
谁能告诉我如何解决这个问题。
【问题讨论】:
标签: drupal url-rewriting