zoukankan      html  css  js  c++  java
  • Thinkphp 配置不用输入index.php

    版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
    本文链接:https://blog.csdn.net/u011186019/article/details/78495461

    由:http://127.0.0.1/thinkphp/index.php/index/index

    改成:http://127.0.0.1/thinkphp/index/index

    Apache服务器

     1、在http.conf配置文件中加载mod_rewrite模块

    1 #LoadModule rewrite_module modules/mod_rewrite.so把前面的警号去掉

     2、在配置文件中

     1  <Directory "c:/wamp/bin/apache/apache2.4.9/cgi-bin">
     2  
     3 AllowOverride ALL # 原来的是None
     4  
     5 Options None
     6  
     7 Order allow,deny
     8  
     9 Allow from all
    10  
    11 </Directory>

    3、在根目录增加文件.htaccess文件(注意windown无法创建(.)开头的文件,解决办法自行百度) 

     1 <IfModule mod_rewrite.c>
     2  
     3 Options +FollowSymlinks
     4  
     5 RewriteEngine On
     6  
     7  
     8  
     9 RewriteCond %{REQUEST_FILENAME} !-d
    10  
    11 RewriteCond %{REQUEST_FILENAME} !-f
    12  
    13 RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
    14  
    15 </IfModule>
    4、重启服务器即可
  • 相关阅读:
    test
    4css
    3css
    2css
    5html
    1css
    4html
    3html
    2html
    1.3 tensorflow2.0 常用函数
  • 原文地址:https://www.cnblogs.com/mython/p/11494084.html
Copyright © 2011-2022 走看看