VPS侦探论坛

 找回密码
 注册
查看: 3948|回复: 2

军哥,请教二级目录安装emlog的伪静态规则

[复制链接]
发表于 2015-5-8 21:13:05 | 显示全部楼层 |阅读模式

使用二级目录安装emlog,但是在配置伪静态的时候出现点问题,能麻烦军哥帮忙解决一下吗,谢谢
  1. location / {
  2.         index index.php index.html;
  3.         if (!-e $request_filename)
  4.         {
  5.                 rewrite ^/(.+)$ /index.php last;
  6.         }
  7. }
复制代码


使用以上伪静态,主域名可以访问,安装emlog的二级目录首页也可以访问,但是栏目及内容页无法访问。于是尝试更改伪静态规则:
  1. location / {
  2.         index index.php index.html;
  3.         if (!-e $request_filename)
  4.         {
  5.                 rewrite ^/二级目录/(.+)$ /二级目录/index.php last;
  6.         }
  7. }
复制代码


使用以上规则配置之后,安装emlog的二级目录首页可以访问,栏目及内容页也可以访问,但是主域名却无妨访问了。
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2015-5-8 21:22:29 | 显示全部楼层


貌似解决了,是文件配置问题……
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2015-5-10 09:58:14 | 显示全部楼层

location /emlog目录名字/ 就行了
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-27 17:27 , Processed in 0.025945 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表