因此,我的本地服务器从未出现过问题,因为我从未与其他人一起在多个网站上进行开发。
但是,现在通过访问辅助站点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 被重写