Xampp虚拟主机用于子目录

时间:2014-04-24 12:23:11

标签: php apache xampp virtualhost httpd.conf

问题

我想映射

www.mydomain.com/some/url

C:/xampp/htdocs/some/dir

我得到了什么

  • XAMPP
  • WordPress的

htaccess的

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /some/path/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /some/path/index.php [L]
</IfModule>

托管文件

127.0.0.1 www.mydomain.com

httpd-vhosts.conf (包含在httpd.conf中)

<VirtualHost *:80>
    DocumentRoot "C:/xampp/htdocs/someDir/"
    ServerName mydomain.com/some/path
</VirtualHost>

其他信息(httpd.conf)

DocumentRoot "C:/xampp/htdocs"

<Directory "C:/xampp/htdocs">
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Require all granted
</Directory>

当前结果

500内部服务器错误日志显示

Request exceeded the limit of 10 internal redirects due to probable configuration error. 

1 个答案:

答案 0 :(得分:5)

将别名添加到 httpd.conf

DocumentRoot "C:/xampp/htdocs"

<Directory "C:/xampp/htdocs">
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Require all granted
</Directory>

Alias /some/url C:/xampp/htdocs/some/dir