tp url 隐藏 public/index.php

作者: 时间:2019-05-14 21:17:32

1.php5.6  apache环境前提

2.public下的index.php和伪静态.htaccess迁到根上

3.index.php修改路径

image.png

4.伪静态.htaccess 修改

<IfModule mod_rewrite.c>

  Options +FollowSymlinks -Multiviews

  RewriteEngine On

  RewriteCond %{REQUEST_FILENAME} !-d

  RewriteCond %{REQUEST_FILENAME} !-f

  RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]

</IfModule>

版权所有 博曦云 2019