阿里云 万网 虚拟主机 如何部署 thinkphp 项目 配置伪静态 .htaccess

默认是 linux 系统 Apache 

1. 设置项目更目录到/public

2. 在根目录添加 .htaccess 文件:

<IfModule mod_rewrite.c>
 RewriteEngine on
 RewriteBase /
 RewriteCond %{REQUEST_URI} !^/public/
 RewriteRule ^(.*)$ public/$1?Rewrite [L,QSA]
</IfModule>


3. 在public 目录添加 .htaccess 文件:

<IfModule mod_rewrite.c>
 Options +FollowSymlinks
 RewriteEngine On
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>


整理好了的 发 邮箱(309)