原来的路径是:
http://xxxxxxx/index.php/admin/login/index.html

修改完的路径:
http://xxxxxxx/admin/login/index.html

修改.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
修改配置文件
location / {
if (!-e $request_filename){
rewrite ^/(.*)$ /index.php?s=/$1 last;
}
}
URL重写技巧

本文介绍如何通过修改.htaccess和nginx配置文件实现URL重写,简化网站路径,提升用户体验。包括Apache的mod_rewrite模块使用和nginx的rewrite指令配置方法。
1213

被折叠的 条评论
为什么被折叠?



