thinkphp5.0 URL 隐藏index.php URL重写 一些注意的问题

1. apache 要确保是否开启重写模块  (在 httpd.conf 配置文件中 启用 mod_rewrite.so模块 #LoadModule rewrite_module modules/mod_rewrite.so把前面的警号去掉

2.  AllowOverride None 讲None改为 All  在apache里面去配置 (注意其他地方的AllowOverride也要设置为All)

           
                AllowOverride none  改   AllowOverride ALL
                Options None
                Order allow,deny
                Allow from all

            

3. 伪静态文件 修改如下:

           
                Options +FollowSymlinks
                RewriteEngine On
                RewriteCond %{REQUEST_FILENAME} !-d
                RewriteCond %{REQUEST_FILENAME} !-f
                RewriteRule ^(.*)$ index.php?s=$1 [QSA,PT,L]  #或 RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
               

        

    

你可能感兴趣的:(thinkphp5,thinkphp5)