Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/index.php HTTP_HOST bug #6

Closed
h4dex opened this issue Jan 9, 2017 · 1 comment
Closed

/index.php HTTP_HOST bug #6

h4dex opened this issue Jan 9, 2017 · 1 comment

Comments

@h4dex
Copy link
Contributor

h4dex commented Jan 9, 2017

在不同端口下
HTTP_HOST 会匹配完整的HOST ppphpadmin.m.com:8080 则 无法跳转 后台 /API 等 模块

原code如下

if ($_SERVER['HTTP_HOST'] == 'ppphpadmin.m.com' || $_SERVER['HTTP_HOST'] == 'ppphpadmin.kphcdr.com') {
    $MODULE_NAME = 'admin';
} else {
    $MODULE_NAME = 'app';
}

改进方法 Q&A 2

1.修改 HTTP_HOST 为 SERVER_NAME
2.strpos(); 验证字符串是否存在

h4dex pushed a commit to h4dex/ppphp that referenced this issue Jan 9, 2017
修改HTTP_HOST 为 SERVER_NAME方式,适配非80端口访问无法访问其他模块的BUG 详情见issues kphcdr#6 kphcdr#6
@kphcdr
Copy link
Owner

kphcdr commented Jan 9, 2017

可以的,提交requests吧

@kphcdr kphcdr closed this as completed Apr 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants