【发布时间】:2013-12-18 12:09:23
【问题描述】:
我们正在更改我们的域名,这旨在适用于独立应用程序。在 Apache 虚拟主机文件中,DocumentRoot 是 /var/www/website/html,而不是本块中的 /var/www/example/html:
Alias /apps/dept /var/www/example/html/apps/dept
<Directory "/var/www/example/html/apps/dept/">
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
我在 /var/www/example/html/apps/dept 目录下放了一个 .htaccess 文件,如下:
RewriteEngine On
RewriteBase /apps/dept/
RewriteCond %{HTTP_HOST} ^example.orgname.state.tx.us/apps/dept [NC]
RewriteRule ^(.*)$ http://example.orgname.texas.gov/apps/dept/$1 [L,R=301]
这似乎遵循这里的建议,http://httpd.apache.org/docs/current/mod/mod_rewrite.html 和 Apache : How to Use Rewrite Engine Inside Alias。我看不到任何结果。新域在 VH 文件中也有一个虚拟主机配置。同样的基本重写适用于我们不使用别名的 Drupal 网站。使用附加的应用程序路径名重写域名可能需要进行哪些更改? RewriteBase 不正确吗?
谢谢。
【问题讨论】:
标签: apache .htaccess mod-rewrite url-rewriting