![Apache 上的多个 Drupal 安装可以使用它们自己的 DNS 条目,但不能使用 Alias](https://linux22.com/image/1359787/Apache%20%E4%B8%8A%E7%9A%84%E5%A4%9A%E4%B8%AA%20Drupal%20%E5%AE%89%E8%A3%85%E5%8F%AF%E4%BB%A5%E4%BD%BF%E7%94%A8%E5%AE%83%E4%BB%AC%E8%87%AA%E5%B7%B1%E7%9A%84%20DNS%20%E6%9D%A1%E7%9B%AE%EF%BC%8C%E4%BD%86%E4%B8%8D%E8%83%BD%E4%BD%BF%E7%94%A8%20Alias.png)
因此,我的本地服务器从未出现过问题,因为我从未与其他人一起在多个网站上进行开发。
但是,现在通过访问辅助站点Alias
遇到了问题,因为主站点(drupal)的重定向启动并返回 404。使用来自主机的域可以正常工作。
主站点localhost
位于~/www
,辅助站点localhost/second
位于~/second
第二个站点的配置文件如下:
# Allow lan to access the site without modifying their hosts files
Alias /second /home/j/second
<VirtualHost *:80>
ServerAdmin webmaster@localhost
# Allow me to access it from domain in hosts file
ServerName second.local
# And when I do that undo the alias
Alias /second /home/j/second/second
DocumentRoot /home/j/second
<Directory /home/j/second>
Options FollowSymLinks
AllowOverride All
Order deny,allow
deny from all
allow from 192.168.1
allow from 127.0.0.1
</Directory>
</VirtualHost>
实际发生的情况:
localhost
应该加载
~/www
并加载
~/www
localhost/second
应该加载
~/second
并加载
~/second
localhost/second/about
应该加载
~/second/index.php?q=about
,但加载
~/www/index.php?q=second/about
我如何才能让它按照预期做出响应?
答案1
您可以在 drupal 站点根目录中找到 .htaccess 文件,并查看 rewriterule/rewritebase 指令。您的 URL 被重写