访问 http://localhost/student/xxx 失败 1
访问 http://localhost/index.php/student/xxx   成功
规则如下。
RewriteRule ^(.*)/student/(.+) $1/index.php?num=student&key=$2
我想让最上面那个格式可以访问。如何修改规则

解决方案 »

  1.   

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} -s [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ - [NC,L]
    RewriteRule ^.*$ index.php [NC,L]
      

  2.   

    RewriteRule ^student/(.*)$  index.php?num=student&key=$1RewriteRule ^/student/(.*)$  /index.php?num=student&key=$1
      

  3.   

    RewriteRule ^student/(.+)$ index.php?num=student&key=$1 [L]
    我的是 apache 上面这条规则适用。唉。
      

  4.   

    Loaded Modules  core mod_win32 mpm_winnt http_core mod_so mod_actions mod_alias mod_asis mod_auth_basic mod_authn_default mod_authn_file mod_authz_default mod_authz_groupfile mod_authz_host mod_authz_user mod_autoindex mod_cgi mod_dir mod_env mod_include mod_isapi mod_log_config mod_mime mod_negotiation mod_rewrite mod_setenvif mod_php5  求高手!
    上面的phpinfo界面是不是已经支持了urlrewrite了,大家帮我看看啊
    下面的这个是htaccess里的规则代码:
    <IfModule mod_rewrite.c>
                RewriteEngine On
                RewriteRule user-([0-9]+).html file.php?t=$1
    </IfModule>
    url里面输入http://127.0.0.1/user-11.html
    总是出现无页面啊啊。。
    可我已有file.php在根目录下
    代码<?php
    $thing=$_GET['t'];
    echo $thing;
    ?>
    求高手指导!
    !!!