ThinkPHP3.2 伪静态配置
前台伪静态且隐藏入口文件 就把“.htaccess文件” 放到指定文件夹下面 如图home做伪静态并隐藏入口文件:
Apache为例,需要在入口文件的同级添加.htaccess文件
如果用的phpstudy:
1: <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]
// index.php 是当前的入口文件 这里写的是隐藏当前文件夹下的入口文件(隐藏项目的入口文件 找对路劲 隐藏 就对了)
</IfModule>
{如果index.php文件存放在public中,规则如下:
<IfModule mod_rewrite.c> Options +FollowSymlinks -Multiviews RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ public/index.php [L,E=PATH_INFO:$1]
</IfModule>} 2: config的配置文件加如下几点:
'URL_MODEL'=>2, //模式
'URL_HTML_SUFFIX' => '.html', // 后缀
'URL_DENY_SUFFIX' => 'pdf|ico|png|gif|jpg|gif', // URL禁止访问的后缀设置
'URL_ROUTER_ON' => true, //开启路由
'URL_ROUTE_RULES' => array(
'index'=>'Index/index',
), 3: 但是访问方式必须是用 U函数
Httpd文件 第二个 修改成如下:
<Directory "F:/GZJ/phpstudy/sdystar/Apache/cgi-bin">
AllowOverride All
Options None
Require all granted
# RewriteEngine On
# RewriteRule ^(.*)\.htm$ $1.html
</Directory> Httpd.conf中必须开启(去掉前面的#)
LoadModule rewrite_module modules/mod_rewrite.so
ThinkPHP3.2 伪静态配置的更多相关文章
- DZ 3.2 URL 伪静态配置 教程
原文转自:http://www.zccode.com/thread-682-1-1.html 教程说明: 1 首先需要下载URL重写工具,拷到服务器下面安装即可,这里配置IIS7(x64)伪静态. 工 ...
- IIS伪静态配置,使用URLRewriter实现伪静态
前段时间开发公司官网,用到了URLRewriter实现伪静态,在VS调试模式下没有任何问题,部署到IIS上后总是提示404的错误,查了很久才知道IIS需要做相应的配置才能实现动态跳转的功能,现将IIS ...
- PHP各环境下的伪静态配置
一.Apache的伪静态配置 1.网站根目录下需要有 .htaccess 文件,没有则自己创建一个,内容为 <IfModule mod_rewrite.c> RewriteEngine o ...
- Nginx伪静态配置和常用Rewrite伪静态规则集锦
伪静态是一种可以把文件后缀改成任何可能的一种方法,如果我想把php文件伪静态成html文件,这种相当简单的,下面我来介绍nginx 伪静态配置方法 nginx里使用伪静态是直接在nginx.conf ...
- Nginx 服务器伪静态配置不当造成 Access denied
Nginx 服务器伪静态配置不当造成 Access denied 有群有反馈将 FastAdmin 布署到阿里云后无法打开后台. 出现如下提示,首页是可以打开,点登录链接后出现的.(下是群友的截图) ...
- Windows server 2003 伪静态配置方法
Windows server 2003 伪静态配置方法 先我们下载Rewrite伪静态组件到服务器,然后解压到D:\Rewrite下,解压后如下图: 提示:ReWrite组件所在目录要有网站所有者 ...
- [转]Nginx伪静态配置和常用Rewrite伪静态规则集锦
Nginx伪静态配置和常用Rewrite伪静态规则集锦 作者: 字体:[增加 减小] 类型:转载 时间:2014-06-10 我要评论 伪静态是一种可以把文件后缀改成任何可能的一种方法,如果我想把ph ...
- 【转】 nginx rewrite 伪静态配置参数详细说明
nginx rewrite 伪静态配置参数和使用例子 附正则使用说明 正则表达式匹配,其中: * ~ 为区分大小写匹配 * ~* 为不区分大小写匹配 * !~和!~*分别为区分大小写不匹配及不区分 ...
- 伪静态 net-IIS伪静态配置,使用URLRewriter实现伪静态
https://www.cnblogs.com/zhenzaizai/p/10364343.html 前段时间开发公司官网,用到了URLRewriter实现伪静态,在VS调试模式下没有任何问题,部署到 ...
随机推荐
- c# 文件过大时清空原有内容重新写入
FileStream fs = new FileStream("E:\\Test\\HistoryData.txt", FileMode.Append, FileAccess.Wr ...
- MAP使用方法集合
一.整理: 看到array,就要想到角标. 看到link,就要想到first,last. 看到hash,就要想到hashCode,equals. 看到tree,就要想到两个接口.Comparable, ...
- Codeforces Beta Round #57 (Div. 2)
Codeforces Beta Round #57 (Div. 2) http://codeforces.com/contest/61 A #include<bits/stdc++.h> ...
- 通达OA 自定义菜单
1.首先在系统管理----菜单设置中添加菜单主分类,菜单的图片默认是在D:\MYOA\webroot\images中.2.然后再编辑该菜单的下一级,增加子菜单项,子菜单的路径就是您要设置的网址.3.最 ...
- [leetcode]791. Custom Sort String自定义排序字符串
S and T are strings composed of lowercase letters. In S, no letter occurs more than once. S was sort ...
- TableViewCell去除选中效果
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ [tableV ...
- 微信公众号H5支付步骤
微信公众平台:https://mp.weixin.qq.com/ 进入 微信支付 管理>开通支付功能. 微信支付|商户平台: 设置安全目录:https://pay.weixin.qq.com/i ...
- pop_heap(_RAIter,_RAIter,_Compare)
make_heap()是生成一个堆,大顶堆或小顶堆 make_heap(_RAIter,_RAIter) 默认生成大顶堆 make_heap(_RAIter,_RAIter,_Compare) _Co ...
- PAT 甲级 1011 World Cup Betting (20)(代码+思路)
1011 World Cup Betting (20)(20 分) With the 2010 FIFA World Cup running, football fans the world over ...
- andorid 练习微信登陆
AndroidManifest.xml layout1.xml <?xml version="1.0" encoding="utf-8"?> < ...
