我正在将我的域名从 foo.com 更改为 foobar.org。我在 apache 配置文件中使用了Redirect permanent
,然后重新启动了 apache。当我尝试访问旧域名 foo.com 时,出现 403 错误。
我的 apache 配置文件如下所示:
<VirtualHost *:80>
ServerName foo.com
#ServerAlias www.foo.com
#ServerAdmin [email protected]
Redirect permanent / http://www.foobar.org/
DocumentRoot /path/to/project/foo/web
DirectoryIndex index.php
# CustomLog with format nickname
LogFormat "%h %l %u %t \"%r\" %>s %b" common
CustomLog "|/usr/bin/cronolog /var/log/apache2/%Y%m.foo.access.log" common
LogLevel notice
ErrorLog "|/usr/bin/cronolog /var/log/apache2/%Y%m.foo.errors.log"
<Directory />
Order Deny,Allow
Deny from all
</Directory>
<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>
<Directory /path/to/project/foo/web>
Options -Indexes -Includes
AllowOverride All
Allow from All
RewriteEngine On
# We check if the .html version is here (cacheing)
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.])$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
# No, so we redirect to our front end controller
RewriteRule ^(.*)$ index.php [QSA,L]
</Directory>
<Directory /path/to/project/foo/web/uploads>
Options -ExecCGI -FollowSymLinks -Indexes -Includes
AllowOverride None
php_flag engine off
</Directory>
Alias /sf /lib/vendor/symfony/symfony-1.3.8/data/web/sf
<Directory /lib/vendor/symfony/symfony-1.3.8/data/web/sf>
# Alias /sf /lib/vendor/symfony/symfony-1.4.19/data/web/sf
# <Directory /lib/vendor/symfony/symfony-1.4.19/data/web/sf>
Options -Indexes -Includes
AllowOverride All
Allow from All
</Directory>
</VirtualHost>
有人能发现我可能做错了什么吗?网站 foobar.org 确实存在,所以我不知道为什么会出现这个错误 - 帮忙吗?