-
Notifications
You must be signed in to change notification settings - Fork 446
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
reroute() uses SERVER_NAME as base instead #1140
Comments
Which behaviour would you expect each to provide if performed at the following URLs?:
If you expect them (i.e. both with and without the leading Meanwhile, same question for the following HTML in any <a href="relative_page.htm">Relative</a>
<a href="/absolute_page.htm">Absolute</a> |
With the following route setting:
I expect this behavior:
The same applies to $f3->reroute(). Question is .. why Case 1 changes the URL base domain to "server_name" |
The call without a leading |
I know without leading slash is not recommended. See my behaviour #1 explained above. F3 uses replace root url to server_name which may break if the server is behind a proxy server. |
It doesn't replace the root url.. the point is, that with leading So yes we should probably fix |
@lsafelix75 so what to use instead of $f3 = \Base::instance();
$f3->set('HOST', '127.0.0.1'); |
I've also got a weird issue but I won't consider it as a bug but it's related to this issue. While using the PHP embedded server to dev my project locally, I've used Everything was running smooth until the use of Maybe I did something wrong so no need to open another issue. @ikkez is it a wanted behavior? |
That's no bug, it's a feature 😁 and if so, it perfectly fit into this issue here. |
@ikkez Thanks for your reply, so no need to debug it's more on my side 👍 |
@ikkez it still doesn't solve the problem. May be i set to another example with similar route setting as above:
However, if i change the route setting to:
Not sure how this will resolve my issue. With the following, basically, you are constructing a new absolute URL instead of relative URL from the base.
|
i suggest you remove the following entirely. I am not sure what is the implication for other parts, by taking out this part, it is basically to construct a relative URL instead of an absolute URL if we do reroute()
|
It is mandatory to build an absolute location url, the patch at f3-factory/fatfree-core@1e409a3 fixes this issue and the behaviour should be similar now (rerouting to |
Hi,
I encounter this strange behaviour of F3 lately. Both $f3->reroute('/en') and and $f3->reroute('en') have different behaviours. With $f3->reroute('/en'), the rerouted URL has the 'base url' change to SERVER_NAME defined in NGINX ini, whilst $f3->reroute('en') maintain the 'base url'. Is this an expected bahavior?
The text was updated successfully, but these errors were encountered: