当前位置:首页 > Web开发 > 正文

修改.htaccess文件 IfModule mod_rewrite.c Options +FollowSymlink

2024-03-31 Web开发

改削.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>

添加nginx配置,如果使用的浮屠linux,,直接在网址->单个网站设置->配置文件中合适的处所加上下面的代码即可

location / { if (!-e $request_filename){ rewrite ^/(.*)$ /index.php?s=http://www.mamicode.com/$1 last; } }

tp5.1 nginx环境下url去失index.php

温馨提示: 本文由Jm博客推荐,转载请保留链接: https://www.jmwww.net/file/web/30392.html