设为首页
收藏本站
Archiver
用户
登录
入住
用户名
Email
自动登录
找回密码
密码
登录
入住 CI 中国社区
首页
返回 CodeIgniter 中国首页
论坛
BBS
导读
Guide
个人主页
Space
中文手册
搜索
CodeIgniter 搜索引擎
视频教程
案例
任务
搜索
搜索
本版
帖子
用户
设为首页
收藏本站
Archiver
开启辅助访问
切换到宽版
日志
相册
分享
记录
CodeIgniter4
CodeIgniter3
CodeIgniter2
帖子
好友
道具
勋章
收藏
任务
记录
留言板
设置
我的收藏
退出
腾讯QQ
微信登录
CodeIgniter 中国开发者社区
»
论坛
›
CodeIgniter 开发
›
CodeIgniter 问答求助
›
Nginx下Urlrewrite的配置
返回列表
查看:
4389
|
回复:
2
[HELP]
Nginx下Urlrewrite的配置
[复制链接]
幻想曲
幻想曲
当前离线
积分
228
IP卡
狗仔卡
发表于 2012-1-12 11:16:14
|
显示全部楼层
|
阅读模式
之前在Apache下可以配成:
http://localhost/show/1
这样的链接,实际URL是:http://localhost/index.php?m=index&c=show&id=1
现在到nginx下之后,访问
http://localhost/show/1会提示404,不知道这个该怎么写?
apache下的.htaccess是这样写的:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]
怎么对应到Nginx中呢?
回复
使用道具
举报
提升卡
置顶卡
沉默卡
喧嚣卡
变色卡
千斤顶
显身卡
sdink
sdink
当前离线
积分
5133
IP卡
狗仔卡
发表于 2012-1-12 11:54:16
|
显示全部楼层
网站找一个,可以把Apache的转成Nginx的 ,不过Nginx有些问题要写在config里
回复
支持
反对
使用道具
举报
显身卡
cpass
cpass
当前离线
积分
1167
IP卡
狗仔卡
发表于 2012-3-13 11:43:51
|
显示全部楼层
PHP
复制代码
rewrite
"^/(?!index\.php|robots\.txt|images|js|stylesheets)(.*)$"
/
index
.
php
/
$
1
last
;
if
(
!-
e
$request_filename
)
{
rewrite ^
.*
$
/
index
.
php last
;
}
复制代码
写在 “location / {}” 段里。
不过问题没这么简单,还有path_info的问题,我到这里走不下去了。
回复
支持
反对
使用道具
举报
显身卡
返回列表
高级模式
B
Color
Image
Link
Quote
Code
Smilies
您需要登录后才可以回帖
登录
|
入住 CI 中国社区
本版积分规则
发表回复
回帖后跳转到最后一页