修改.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]
#RewriteRule ^(.*)$ public/index.php [L,E=PATH_INFO:$1]
# RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
# RewriteRule ^(.*)$ public/index.php [L,E=PATH_INFO:$1]
# RewriteRule ^(.*)$ public/index.php [L,E=PATH_INFO:$1]
</IfModule>
重启apache,5种方法都无效。
请高手指点一下。 tp版本5.1.36 。环境win7
<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?/$1[QSA,PT,L]
#RewriteRule ^(.*)$ public/index.php [L,E=PATH_INFO:$1]
# RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
# RewriteRule ^(.*)$ public/index.php [L,E=PATH_INFO:$1]
# RewriteRule ^(.*)$ public/index.php [L,E=PATH_INFO:$1]
</IfModule>
重启apache,5种方法都无效。
请高手指点一下。 tp版本5.1.36 。环境win7
我用这句还是无效。
RewriteRule ^(.*)$ index.php?/$1[QSA,PT,L]
1.Apache
<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>
2.phpstudy
<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>看清楚其中的差别 集成环境去掉/$1如果是nginx
1.lnmp
直接引用集成环境中的重写信息 有打包好的
2.nginx
location / { // …..省略部分代码
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=/$1 last;
break;
}
}