Nginx如何来配置隐藏入口文件index.php(代码)
Nginx配置文件里放入这段代码
server {
location / {
index index.php index.html index.htm l.php;
autoindex on;
if (!-e $request_filename) {
#一级目录
# rewrite ^/(.*)$ /index.php/$1 last;
#二级目录,这里注意修改成自己的项目目录
rewrite ^/rent/public/(.*)$ /rent/public/index.php/$1 last;
}
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php(.*)$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
include fastcgi_params;
}
}
Nginx如何来配置隐藏入口文件index.php(代码)的更多相关文章
- Nginx配置 隐藏入口文件index.php
Nginx配置文件里放入这段代码 server { location / { index index.php index.html index.htm l.php; autoindex on; if ...
- CI 框架怎么去掉隐藏入口文件 index.php
当我重新接触一个框架的时候首先肯定要去掉入口文件,也就是index.php 这个东西在url上很不漂亮,而且每次我访问我的网站的时候都要打进去url里面.这样告诉一个去掉 CI框架里面入口文件的方法, ...
- ThinkPHP5.X PHP5.6.27-nts + Apache 通过 URL 重写来隐藏入口文件 index.php
我们先来看看官方手册给出关于「URL 重写」的参考: 可以通过 URL 重写隐藏应用的入口文件 index.php ,Apache 的配置参考: 1.http.conf 配置文件加载 mod_rewr ...
- nginx隐藏入口文件index.php
网站的访问url可能是这样http://www.xxx.com/index.php/home/index/index 这种有点不美观,我们想达到如下效果http://www.xxx.com/home/ ...
- 【apache】phpstudy中apache 隐藏入口文件index.php (解决no input file specified错误)
步骤: 下面我说下 apache 下 ,如何 去掉URL 里面的 index.php 例如: 你原来的路径是: localhost/index.php/Index/index改变后的路径是: loca ...
- Apache 隐藏入口文件 index.php
新建 .htaccess文件至站点目录下,并写入如下代码: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQ ...
- CI隐藏入口文件index.php
1.需要apache打开rewrite_module,然后修改httpd.conf的AllowOverride none 为AllowOverride All(里面,不同的环境目录不同) 2.在CI的 ...
- TP5 隐藏入口文件 index.php
找到public下的.htaccess <IfModule mod_rewrite.c> Options +FollowSymlinks -Multiviews RewriteEngine ...
- niginx隐藏入口文件index.php
location / { if (!-e $request_filename) { rewrite ^/(.*)$ /index.php/$ last; break; } }
随机推荐
- docker系列详解<二>之常用命令
此篇我们以从docker运行一个tomcat为例,进行一下操作: 拉取镜像 查看镜像 创建容器 查看运行状态 进入退出容器 停止容器 重启容器 删除容器 删除镜像 1.拉取tomcat镜像: 1).查 ...
- iOS 原生实现生成二维码(CoreImage)工具类,不依赖第三方库,可自定义背景颜色,添加logo(Swift 4.0)
import Foundation import CoreImage import UIKit extension UIColor { var coreImageColor: CIColor { re ...
- Oracle 中文日期转换
中文日期转换 select to_char(to_date('07-5月-17'),'yyyy-MM-dd HH24:mi:ss') from dual
- [Docker7]Harbor
harbor download harbor offline tar package wget https://github.com/vmware/harbor/releases/download/v ...
- IdentityServer4源码解析_4_令牌发放接口
目录 identityserver4源码解析_1_项目结构 identityserver4源码解析_2_元数据接口 identityserver4源码解析_3_认证接口 identityserver4 ...
- [单调栈] 2018-2019 ACM-ICPC, China Multi-Provincial Collegiate Programming Contest-Maximum Element In A Stack
题目:https://codeforces.com/gym/102222/problem/A Maximum Element In A Stack time limit per test 10.0 s ...
- ML Lecture 0-1: Introduction of Machine Learning
本博客是针对李宏毅教授在Youtube上上传的课程视频<ML Lecture 0-1: Introduction of Machine Learning>的学习笔记.在Github上也po ...
- C 2012年笔试题(保)
1 程序改错 1.1 下面程序段的功能是交换两个字符数组的内容(每个字符串字符数均不超过100) (8分) [ 见2012年笔试题1.1] void StrSwap(char *pa,char ...
- CF 997A
You’ve got a string a1,a2,…,an, consisting of zeros and ones.Let’s call a sequence of consecutive el ...
- SuperMap许可常见问题及解决办法
一.试用许可申请可以直接在北京超图软件股份有限公司官网的“SuperMap 技术资源中心”申请试用许可,申请后您将获得:1.如果申请的是 SuperMap GIS 7C 系列产品的许可,您将获得 一个 ...