Auston 发表于 2010-12-7 20:25:31

网址后缀问题

怎么让 网址abc.com/aaa   打开aaa.html文件啊
只能输入 abc.com/aaa.html 才能打开.....
不加html 就显示 No input file specified.

网页全是html文件
环境是lnmp.org的意见安装包

hotsnow 发表于 2010-12-7 20:28:25

url rewrite

skywing 发表于 2010-12-7 20:35:48

添加伪静态规则

cuxian 发表于 2010-12-7 20:43:47

把aaa.html改名成index.html放到aaa目录去:lol

小夜 发表于 2010-12-7 20:47:55

伪静态规则:location / {if (!-e $request_filename){
            rewrite ^/(.+)$ /$1.html last;
      }
}伪态规则添加方法:www.vpsmm.com/edu/162.html

Auston 发表于 2010-12-8 17:09:45

原帖由 小夜 于 2010-12-7 20:47 发表 http://www.hostloc.com/images/common/back.gif
伪静态规则:location / {if (!-e $request_filename){
            rewrite ^/(.+)$ /$1.html last;
      }
}伪态规则添加方法:www.vpsmm.com/edu/162.html


谢谢~最喜欢这样详细的回答了:)

   再问下    /abc    貌似不能打开 ABC.html
这个能改不?

cookie 发表于 2010-12-8 17:13:31

lnmp意见安装包yc006t

fangxianzhong 发表于 2010-12-8 17:26:05

回头研究一下   。

Auston 发表于 2010-12-8 18:27:09

回复 5# 的帖子

再问下....

listen       80;
                server_name abc.com;
                index index.html index.htm index.php;
                root/home/wwwroot;
                error_page 404 /404.html;

输入不存在的网址 没有跳到404.html?
出现 500 Internal Server Error

msxcms 发表于 2010-12-8 18:28:55

放到location里面

[ 本帖最后由 msxcms 于 2010-12-8 18:30 编辑 ]
页: [1] 2
查看完整版本: 网址后缀问题