全球主机交流论坛

标题: 网址后缀问题 [打印本页]

作者: Auston    时间: 2010-12-7 20:25
标题: 网址后缀问题
怎么让 网址  abc.com/aaa   打开aaa.html文件啊
只能输入 abc.com/aaa.html 才能打开  .....
不加html 就显示 No input file specified.

网页全是html文件
环境是  lnmp.org的意见安装包
作者: hotsnow    时间: 2010-12-7 20:28
url rewrite
作者: skywing    时间: 2010-12-7 20:35
添加伪静态规则
作者: cuxian    时间: 2010-12-7 20:43
把aaa.html改名成index.html放到aaa目录去  
作者: 小夜    时间: 2010-12-7 20:47
伪静态规则:
  1. location / {if (!-e $request_filename){
  2.             rewrite ^/(.+)$ /$1.html last;
  3.         }
  4. }
复制代码
伪态规则添加方法:www.vpsmm.com/edu/162.html
作者: Auston    时间: 2010-12-8 17:09
原帖由 小夜 于 2010-12-7 20:47 发表
伪静态规则:location / {if (!-e $request_filename){
            rewrite ^/(.+)$ /$1.html last;
        }
}伪态规则添加方法:www.vpsmm.com/edu/162.html



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

   再问下    /abc    貌似不能打开 ABC.html
  这个能改不?
作者: cookie    时间: 2010-12-8 17:13
lnmp意见安装包
作者: fangxianzhong    时间: 2010-12-8 17:26
回头研究一下   。
作者: Auston    时间: 2010-12-8 18:27
标题: 回复 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
放到location里面

[ 本帖最后由 msxcms 于 2010-12-8 18:30 编辑 ]
作者: foxlovefox    时间: 2010-12-8 19:34
我是进来看头像的。。。
作者: Showfom    时间: 2010-12-8 19:38
伪静态。。。。
作者: Cokid    时间: 2010-12-9 00:07
有人解决了...




欢迎光临 全球主机交流论坛 (https://lilynana.eu.org/) Powered by Discuz! X3.4