thinkphp路径出现问题?路径找不到 而且url必须有index.php

当使用thinkphp的时候路径出现问题 路径找不到

而且url必须有index.php 没有就找不到地址,怎么办

  1. 在网站根目录下增加一个文件.htaccess
  2. 然后写下如下的的内容
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]
</IfModule>

3.重启Apache服务器

posted @ 2017-12-26 17:52  孙中明  阅读(258)  评论(0编辑  收藏  举报