在我的 apache 配置中,我创建了一个别名:
<IfModule alias_module>
Alias /projecten "C:/Users/Youri/SkyDrive/Projecten"
</IfModule>
<Directory "C:/Users/Youri/SkyDrive/Projecten">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride FileInfo Options
#
# Controls who can get stuff from this server.
#
Require all granted
</Directory>
在“projecten/mvc”文件夹中,我有一个 .htacces 文件:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*) public/$1 [L]
</IfModule>
当我转到浏览器http://localhost/projecten/mvc/时,我收到一条错误消息:
在此服务器上找不到请求的 URL /Users/Youri/SkyDrive/Projecten/mvc/public/。
当我将文件夹(mvc)复制到我的文档根目录并导航到http://localhost/mvc/时,重写工作..
当我添加到我的项目文件夹中的 htaccess 文件时:
RewriteBase /projecten/mvc
它可以工作,但我不想添加 RewriteBase,因为当我将它放在文档根目录中时,我不需要它......
有人可以告诉我出了什么问题吗?
Apache/2.4.10 (Win64) OpenSSL/1.0.1j PHP/5.6.4 已配置