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

Bug give_get_current_page_url() $_SERVER["SERVER_NAME"] #530

Closed
remcotolsma opened this issue Mar 16, 2016 · 0 comments
Closed

Bug give_get_current_page_url() $_SERVER["SERVER_NAME"] #530

remcotolsma opened this issue Mar 16, 2016 · 0 comments
Assignees
Milestone

Comments

@remcotolsma
Copy link

The give_get_current_page_url() function is not working correctly on all nginx configurations. I use a name-based virtual hosting environment with nginx:

http://bneijt.nl/blog/post/name-based-virtual-hosting-with-nginx/

The value of $_SERVER['SERVER_NAME'] is:

~^((?<subdomain>.*)\.)?(?<domain>[^.]+)\.(?<tld>[^.]+)$

This is causing all kind of issues, I think you should use $_SERVER['HTTP_HOST']:

$current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];

For now i fixed it by adding this to the wp-config.php file:

$_SERVER['SERVER_NAME'] = $_SERVER['HTTP_HOST'];
@remcotolsma remcotolsma changed the title Bug give_get_current_page_url() $_SERVER["SERVER_NAME"] Bug give_get_current_page_url() $_SERVER["SERVER_NAME"] Mar 16, 2016
@DevinWalker DevinWalker self-assigned this Mar 22, 2016
@DevinWalker DevinWalker added this to the 1.3.7 milestone Mar 22, 2016
DevinWalker pushed a commit that referenced this issue Mar 22, 2016
@DevinWalker DevinWalker mentioned this issue Mar 22, 2016
DevinWalker pushed a commit that referenced this issue Mar 22, 2016
…d by the theme; default to WP's "large" like twenty sixteen any many themes do appropriately #530
@DevinWalker DevinWalker modified the milestones: 1.3.7, 1.4 Mar 25, 2016
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