yii框架如何配置路由
框架(架构)  /  管理员 发布于 5年前   87
首先要在服务器配置(httpd.conf)中开启重写模块:
#开启重写模块,将其前面的#去掉LoadModule rewrite_module modules/mod_rewrite.so#Directory中允许覆盖开启<Directory "${SRVROOT}/htdocs"> # # Possible values for the Options directive are "None", "All", # or any combination of: # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews # # Note that "MultiViews" must be named *explicitly* --- "Options All" # doesn't give it to you. # # The Options directive is both complicated and important. Please see # http://httpd.apache.org/docs/2.4/mod/core.html#options # for more information. # Options Indexes FollowSymLinks # # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # Options FileInfo AuthConfig Limit # AllowOverride All # # Controls who can get stuff from this server. # Require all granted</Directory>
(推荐教程:yii框架)
在目录下加入服务器配置文件.htaccess
RewriteEngine on################################ @email [email protected]# @author test################################重写规则#如果是一个目录或者文件,就访问目录或者文件RewriteCond %{REQUEST_FILENAME} !-d#如果文件存在,就直接访问文件,不进行下面的RewriteRuleRewriteCond %{REQUEST_FILENAME} !-fRewriteRule . index.php
在框架配置项\frontend\config\main.php中加入urlManager配置项
'urlManager' => [ 'enablePrettyUrl' => true, 'showScriptName' => false, //'suffix' => '.html',//URL后缀],
更多编程相关内容,请关注编程教程栏目!
以上就是yii框架如何配置路由的详细内容,更多请关注其它相关文章!
123 在
Clash for Windows作者删库跑路了,github已404中评论 按理说只要你在国内,所有的流量进出都在监控范围内,不管你怎么隐藏也没用,想搞你分..原梓番博客 在
在Laravel框架中使用模型Model分表最简单的方法中评论 好久好久都没看友情链接申请了,今天刚看,已经添加。..博主 在
佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法中评论 @1111老铁这个不行了,可以看看近期评论的其他文章..1111 在
佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法中评论 网站不能打开,博主百忙中能否发个APP下载链接,佛跳墙或极光..路人 在
php中使用hyperf框架调用讯飞星火大模型实现国内版chatgpt功能示例中评论 教程很详细,如果加个前端chatgpt对话页面就完美了..Copyright·© 2019 侯体宗版权所有· 粤ICP备20027696号