Jump to content

IONOS hosting and population of $config->httpHost


chrizz
 Share

Recommended Posts

It is driving me nuts... and i hope that someone has faced (and solved) a similar issues already ...

I have a staging website hosted on IONOS. htaccess tells to redirect everything to www.. So the website is reachable via www.stage.website.de. This website includes a form which populates it's action URL via 

$form->action = '//' . $config->httpHost . $page->url;

then the fun part: 

within my local environment and on some other (non-IONOS) server the markup prints as action "www.stage.website.de". On IONOS for whatever reason the action is "stage.website.de" (without www) which makes the form disfunctional (because the POST request is forwared (via htaccess) to www.stage.website.de and it loses it's parameters on the way). If I extend the htaccess to not redirect stage.website.de to www.stage.website.de it works fine. 

has anyone faced the same/similar issue? My current assumption is that IONOS is doing something very special which breaks the automatic detection by PW of the current httpHost. But I have no clue how to fix this, nor where to start searching for it. 

 

Site notes

  • config.php lists both: www.stage.website.de and stage.website.de as httpHosts
  • index.config.php points also both stage/nonstage to the same site directory. 

 

Link to comment
Share on other sites

Hello @chrizz,

just wondering why would like to add "www" to the staging url? Thats seems very unnecessary.

13 hours ago, chrizz said:

$form->action = '//' . $config->httpHost . $page->url;

Instead of adding the $config->httpHost you could try to use $page->httpUrl:

$form->action = $page->httpUrl;

But including the full url for the form action is also unnecessary in my opinion. It should work with just using $page->url.

13 hours ago, chrizz said:

config.php lists both: www.stage.website.de and stage.website.de as httpHosts

I think it would be better to decide for just one host.

As far as I know $config->httpHost chooses the closest matching host. So in your case staging.website.de seems to be a closer match on your server than www.staging.website.de.

 

I would just not use "www" for the staging url and use a relative url for the form action. ?

Regards, Andreas

  • Like 1
Link to comment
Share on other sites

Quote

just wondering why would like to add "www" to the staging url? Thats seems very unnecessary.

That's because I don't want to mess around in the PW-provided htaccess whenever possible. And because the regular site redirects to www. the staging site does as well (same htaccess).

But I think I am close to solve this issue. Your input enabled me to read the documentation again and challenge my current assumptions, that httpHost is determined automatically and httpsHosts should list all available configurations. 

What I am actually confused about is the fact that it is working everywhere as expected - except for IONOS. 

--

and after a short call with their support, I have to admit, that they are quite confused by their own systems. Maybe it was bad luck, with the one support member I was talking to, but they actually saw redirects where no redirects were and vice versa. 

 

And the absolute downer (sorry for OT): Having a wildcard SSL certificate which is claimed to be valid for one domain and all subdomains *DOES NOT* include subdomains like www.stage.website.de. The support recommended to just buy another certificate. 

--

 

end of story:

IONOS is a poor hoster and I have adapted the staging website to be reachable just via stage.website.de

 

thanks anyways ?

 

 

 

 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...