NIUCLOUD是一款SaaS管理后台框架多应用插件+云编译。上千名开发者、服务商正在积极拥抱开发者生态。欢迎开发者们免费入驻。一起助力发展! 广告
[TOC] 目录下简历 . ### thinkPHP(phpStudy环境) ``` <IfModule mod_rewrite.c> Options +FollowSymlinks -Multiviews RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?s=$1 [QSA,PT,L] </IfModule> ``` ## thinkPHP(其他正常环境) ``` <IfModule mod_rewrite.c> Options +FollowSymlinks -Multiviews RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f ## #RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L] 加问号之后可以省略index.php #低版本<php5.4的不需要写问号 #一些环境需要写成RewriteRule ^(.*)$ index.php?/s=$1 [QSA,PT,L] # RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1] 5.5以上的这么写也可以 ## RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L] </IfModule> ``` ##采坑 - url重写问题 .htaccess文件里的内容 内容一样 但是前面每一行多了个空格 居然重写没有生效 ``` <IfModule mod_rewrite.c> Options +FollowSymlinks -Multiviews RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L] </IfModule> ```