1

我最近实现了白标,在更改了我的 VHOSTS 设置后,我发现一些 URL 被剥离,例如:

<VirtualHost *:8166>
   ServerAdmin webmaster@localhost
   DocumentRoot C:\xampp5.2test\htdocs\portal
   ServerName xampp

   <Directory "C:\xampp5.2test\htdocs\portal">
      Options Indexes FollowSymLinks Includes ExecCGI
      AllowOverride All
      Order allow,deny
      Allow from all
   </Directory>
</VirtualHost>

在 apache vhosts 中是这样配置的。但是,当在地址栏示例中写入 localhost:8166 时:

http://localhost:8166/ url 是这样的而不是

http://localhost:8166/portal

像上面一样,我怎样才能让它将完整路径附加到 url

谢谢。

4

1 回答 1

0

根据您的解释,只需更改文档根目录即可:

<VirtualHost *:8166>
   ServerAdmin webmaster@localhost
   DocumentRoot C:\xampp5.2test\htdocs
   ServerName xampp
   RewriteEngine On


   RewriteRule ^/*$ /portal

   <Directory "C:\xampp5.2test\htdocs\portal">
      Options Indexes FollowSymLinks Includes ExecCGI
      AllowOverride All
      Order allow,deny
      Allow from all
   </Directory>
</VirtualHost>
于 2011-12-22T14:45:42.993 回答