nette,localhost,子文件夹上的404

时间:2015-09-18 11:21:45

标签: apache .htaccess localhost nette

我正在使用XAMPP在localhost上运行nette框架。当我进入索引页面时,一切都很好但是当我点击某个子页面的URL时,我得到404错误。

我在apache(httpd-vhosts.conf)别名中设置了我的文档文件夹:

Alias /documents "C:/Users/username/Documents"
<Directory "C:/Users/username/Documents">
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Order allow,deny
    Allow from all
    Require all granted
</Directory>

当我使用网址http://localhost/documents/git/projectXY/www/访问索引页面时,一切正常

但是当我点击带有网址http://localhost/documents/git/projectXY/www/customer/sign/in的按钮时,我收到404错误

在www文件夹中我有htaccess:

# Apache configuration file (see httpd.apache.org/docs/current/mod/quickreference.html)

# disable directory listing
<IfModule mod_autoindex.c>
    Options -Indexes
</IfModule>

# enable cool URL
<IfModule mod_rewrite.c>
    RewriteEngine On
    # RewriteBase /

    # prevents files starting with dot to be viewed by browser
    RewriteRule /\.|^\. - [F]

    # front controller
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule !\.(pdf|js|ico|gif|jpg|png|css|rar|zip|tar\.gz|map)$ index.php [L]
</IfModule>

# enable gzip compression
<IfModule mod_deflate.c>
    <IfModule mod_filter.c>
        AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/javascript application/json application/xml image/svg+xml
    </IfModule>
</IfModule>

知道我做错了什么吗?

1 个答案:

答案 0 :(得分:0)

<强>解: 由于服务器别名,问题出现在.htaccess中。

我刚刚改变了

# RewriteBase /

RewriteBase /documents/git/projectXY/www/