提问者:小点点

web服务器配置使用。htaccess文件


当我试图实现Web服务器配置使用. htaccess它不是重定向我指向的文件。我在httpd.conf中更改了“AllowOveride: All”,并检查了mod重写模块是否启用。但它抛出错误如下,当我尝试的URL"localhost/student-portal/student":

  **Internal Server Error** 
  The server encountered an internal error or misconfiguration and was unable to complete 
  your request. Please contact the server administrator at admin@example.com to inform them 
  of the time this error occurred, and the actions you performed just before this error. 
  More information about this error may be available in the server error log.

.htaccess文件片段

 RewriteEngine on 
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteCond %{REQUEST_FILENAME} !-l

 RewriteRule ^(.*)$ index.php?url=$1 [QSA, L]

index.php

<?php
    $url = $_GET['url'];
    echo '"'.$url.'"'.'is the requested page';
?>

这是我的error.log文件:

[Fri Dec04 13:51:17.923527 2015][core:警报][pid 4796: tid 1172][客户端::1:52258]C:/Bitnami/wampstack-5.5.30-0/apache2/htdocs/学生门户/. htaccess:重写规则:坏标志分隔符


共1个答案

匿名用户

旗帜不允许有空间

改变

RewriteRule ^(.*)$ index.php?url=$1 [QSA, L]

RewriteRule (.*) index.php?url=$1 [QSA,L]

^$开头的平均值

因此,当您使用时*这意味着不需要它们