<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Nette Framework forum : Using Nette Framework : Beginners : Redirecting to :80 port after authorization</title>
<link>https://forum.nette.org/en</link>
<description>Nette Framework forum</description>
<language>en</language>
<docs>http://backend.userland.com/rss</docs>
<item>
	<title>Redirecting to :80 port after authorization (Beginners)</title>
	<dc:creator>iplague</dc:creator>
	<link>https://forum.nette.org/en/35893#p223626</link>
	<guid isPermaLink="false">223626@http://forum.nette.org/en</guid>
	<description>&lt;p&gt;In file:&lt;br&gt;
&lt;strong&gt;/vendor/nette/http/src/Http/RequestFactory.php&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;97–99 line:&lt;br&gt;
&lt;strong&gt;elseif (isset($_SERVER[‘SERVER_PORT’])) {&lt;br&gt;
// $url-&amp;gt;setPort((int) $_SERVER[‘SERVER_PORT’]); // – comment&lt;br&gt;
$url-&amp;gt;setPort((int) ‘443’); // – add this one&lt;br&gt;
}&lt;/strong&gt;&lt;/p&gt;
</description>
	<pubDate>Thu, 04 May 2023 14:45:34 +0200</pubDate>
</item>
<item>
	<title>Redirecting to :80 port after authorization (Beginners)</title>
	<dc:creator>iplague</dc:creator>
	<link>https://forum.nette.org/en/35893#p223625</link>
	<guid isPermaLink="false">223625@http://forum.nette.org/en</guid>
	<description>&lt;p&gt;My project:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/SurkovKostiantyn/students_site_nette&quot;&gt;Git&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now everything works.&lt;/p&gt;
</description>
	<pubDate>Thu, 04 May 2023 14:37:53 +0200</pubDate>
</item>
<item>
	<title>Redirecting to :80 port after authorization (Beginners)</title>
	<dc:creator>Marek Bartoš</dc:creator>
	<link>https://forum.nette.org/en/35893#p223622</link>
	<guid isPermaLink="false">223622@http://forum.nette.org/en</guid>
	<description>&lt;p&gt;Add RouteList – ensure that you use
&lt;code&gt;Nette\Application\Routers\RouteList&lt;/code&gt; and not
&lt;code&gt;Nette\Routing\RouteList&lt;/code&gt;. The Application RouteList would fail
without the required metadata.&lt;/p&gt;
</description>
	<pubDate>Thu, 04 May 2023 12:30:24 +0200</pubDate>
</item>
<item>
	<title>Redirecting to :80 port after authorization (Beginners)</title>
	<dc:creator>Marek Bartoš</dc:creator>
	<link>https://forum.nette.org/en/35893#p223621</link>
	<guid isPermaLink="false">223621@http://forum.nette.org/en</guid>
	<description>&lt;p&gt;&lt;code&gt;addRoute(&apos;sign/out&apos;)&lt;/code&gt; does not seem right, you have a route with
no information how it should be handled. You need to always define at least
presenter, otherwise Nette does not handle the route automatically.&lt;/p&gt;

&lt;p&gt;Either as a variable in mask:&lt;/p&gt;

&lt;pre
class=&quot;language-php&quot;&gt;&lt;code&gt;addRoute(&apos;&amp;lt;presenter&amp;gt;/&amp;lt;action&amp;gt;&apos;)&lt;/code&gt;&lt;/pre&gt;

&lt;ul&gt;
	&lt;li&gt;Matches any url in &lt;code&gt;foo/bar&lt;/code&gt; format&lt;/li&gt;

	&lt;li&gt;e.g. in &lt;code&gt;sign/out&lt;/code&gt; url, &lt;code&gt;sign&lt;/code&gt; is used as a presenter,
	&lt;code&gt;out&lt;/code&gt; is matched as a action&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Or as a constant in metadata:&lt;/p&gt;

&lt;pre class=&quot;language-php&quot;&gt;&lt;code&gt;addRoute(&apos;sign/out&apos;, &apos;Sign:out&apos;)&lt;/code&gt;&lt;/pre&gt;

&lt;ul&gt;
	&lt;li&gt;Matches only &lt;code&gt;sign/out&lt;/code&gt;&lt;/li&gt;

	&lt;li&gt;Always maps request to &lt;code&gt;sign&lt;/code&gt; presenter and action
	&lt;code&gt;out&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Or with alternative syntax for constants:&lt;/p&gt;

&lt;pre
class=&quot;language-php&quot;&gt;&lt;code&gt;addRoute(&apos;sign/out&apos;, [
	&apos;presenter&apos; =&amp;gt; &apos;Sign&apos;,
	&apos;action&apos; =&amp;gt; &apos;out&apos;,
])&lt;/code&gt;&lt;/pre&gt;

&lt;hr&gt;

&lt;p&gt;If fixing your router does not help, add &lt;code&gt;http &amp;gt; proxy&lt;/code&gt; config
to any neon file which is added in &lt;code&gt;app/Bootstrap.php&lt;/code&gt; via
&lt;code&gt;$configurator-&amp;gt;addConfig()&lt;/code&gt;. But general idea is that
&lt;code&gt;common.neon&lt;/code&gt; is for config that is same for all application
instances (e.g. for registering services) while &lt;code&gt;local.neon&lt;/code&gt; is
customized for each server (e.g. database connection settings and http proxy
because they are different)&lt;/p&gt;
</description>
	<pubDate>Thu, 04 May 2023 12:27:04 +0200</pubDate>
</item>
<item>
	<title>Redirecting to :80 port after authorization (Beginners)</title>
	<dc:creator>mskocik</dc:creator>
	<link>https://forum.nette.org/en/35893#p223620</link>
	<guid isPermaLink="false">223620@http://forum.nette.org/en</guid>
	<description>&lt;p&gt;How do you have router configured in the neon file? Can you paste all your
config files (no need for local.neon)?&lt;/p&gt;

&lt;p&gt;Seems like your app is fallbacking to &lt;code&gt;SimpleRouter&lt;/code&gt;, ie. to query
string routing&lt;/p&gt;
</description>
	<pubDate>Thu, 04 May 2023 11:58:33 +0200</pubDate>
</item>
<item>
	<title>Redirecting to :80 port after authorization (Beginners)</title>
	<dc:creator>iplague</dc:creator>
	<link>https://forum.nette.org/en/35893#p223619</link>
	<guid isPermaLink="false">223619@http://forum.nette.org/en</guid>
	<description>&lt;p&gt;router:&lt;/p&gt;

&lt;pre
class=&quot;language-php&quot;&gt;&lt;code&gt;        $router = new RouteList;
        $router
            -&amp;gt;addRoute(&apos;&apos;, &apos;Home:home&apos;)
            -&amp;gt;addRoute(&apos;about&apos;, &apos;Home:about&apos;)
            -&amp;gt;addRoute(&apos;contacts&apos;, &apos;Home:contacts&apos;)
            -&amp;gt;addRoute(&apos;parliament&apos;, &apos;Pages:parliament&apos;)
            -&amp;gt;addRoute(&apos;passport&apos;, &apos;Pages:passport&apos;)
            -&amp;gt;addRoute(&apos;news&apos;, &apos;News:index&apos;)

            -&amp;gt;addRoute(&apos;sign/out&apos;)
            -&amp;gt;addRoute(&apos;sign/in&apos;)
            -&amp;gt;addRoute(&apos;sign/up&apos;);&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;.htaccess file:&lt;/p&gt;

&lt;pre
class=&quot;language-php&quot;&gt;&lt;code&gt;&amp;lt;IfModule mod_rewrite.c&amp;gt;
	RewriteEngine On
	RewriteBase /
	RewriteCond %{HTTPS} !on
    RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
    RewriteRule ^(.*)$ https://%1/$1 [R=301,L]

	# prevents files starting with dot to be viewed by browser
	RewriteCond %{REQUEST_FILENAME} -f
	RewriteRule /\.|^\.(?!well-known/) - [F]

	# front controller
	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteCond %{REQUEST_FILENAME} !-d
	RewriteRule !\.(pdf|js|mjs|ico|gif|jpg|jpeg|png|webp|svg|css|rar|zip|7z|tar\.gz|map|eot|ttf|otf|woff|woff2)$ index.php [L]
&amp;lt;/IfModule&amp;gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;redirect functions, for example:&lt;br&gt;
` $this-&amp;gt;redirect(‘Sign:in’);`&lt;br&gt;
redirect me to:&lt;br&gt;
&lt;code&gt;:80/sign/out?action=in&amp;amp;presenter=Sign&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Please, tell me, I need to edit &lt;strong&gt;common.neon&lt;/strong&gt; config file to
add &lt;strong&gt;http: proxy&lt;/strong&gt; ?&lt;/p&gt;
</description>
	<pubDate>Thu, 04 May 2023 11:29:47 +0200</pubDate>
</item>
<item>
	<title>Redirecting to :80 port after authorization (Beginners)</title>
	<dc:creator>Marek Bartoš</dc:creator>
	<link>https://forum.nette.org/en/35893#p223613</link>
	<guid isPermaLink="false">223613@http://forum.nette.org/en</guid>
	<description>&lt;p&gt;That just shouldn&apos;t work at all. redirectUrl() expects actual url, not Nette
mapping.&lt;/p&gt;

&lt;p&gt;Webhostings usually have IP addresses they use documented. Just look for them
or ask for them. Then place them in config, as described in documentation &lt;a
href=&quot;https://doc.nette.org/en/http/configuration#toc-http-proxy&quot;&gt;https://doc.nette.org/…onfiguration#…&lt;/a&gt;&lt;/p&gt;
</description>
	<pubDate>Wed, 03 May 2023 13:38:49 +0200</pubDate>
</item>
<item>
	<title>Redirecting to :80 port after authorization (Beginners)</title>
	<dc:creator>iplague</dc:creator>
	<link>https://forum.nette.org/en/35893#p223612</link>
	<guid isPermaLink="false">223612@http://forum.nette.org/en</guid>
	<description>&lt;p&gt;just use redirectUrl now&lt;/p&gt;
</description>
	<pubDate>Wed, 03 May 2023 12:59:44 +0200</pubDate>
</item>
<item>
	<title>Redirecting to :80 port after authorization (Beginners)</title>
	<dc:creator>iplague</dc:creator>
	<link>https://forum.nette.org/en/35893#p223606</link>
	<guid isPermaLink="false">223606@http://forum.nette.org/en</guid>
	<description>&lt;p&gt;Unfortunately i don&apos;t know how do to this.&lt;/p&gt;

&lt;p&gt;I use web hosting, https protocol.&lt;br&gt;
` $this-&amp;gt;redirect(‘Sign:in’);` redirect to :80&lt;br&gt;
` $this-&amp;gt;redirectUrl(‘Sign:in’);` works normaly&lt;/p&gt;
</description>
	<pubDate>Tue, 02 May 2023 21:13:45 +0200</pubDate>
</item>
<item>
	<title>Redirecting to :80 port after authorization (Beginners)</title>
	<dc:creator>nightfish</dc:creator>
	<link>https://forum.nette.org/en/35893#p223605</link>
	<guid isPermaLink="false">223605@http://forum.nette.org/en</guid>
	<description>&lt;p&gt;&lt;span class=&quot;mention&quot;&gt;@iplague&lt;/span&gt; Does your site by any chance run behind
a HTTP proxy? If so, you need to &lt;a
href=&quot;https://doc.nette.org/en/http/configuration#toc-http-proxy&quot;&gt;configure
Nette&lt;/a&gt; so that it is able to correctly detect website&apos;s base URL.&lt;/p&gt;
</description>
	<pubDate>Tue, 02 May 2023 20:29:42 +0200</pubDate>
</item>
<item>
	<title>Redirecting to :80 port after authorization (Beginners)</title>
	<dc:creator>iplague</dc:creator>
	<link>https://forum.nette.org/en/35893#p223603</link>
	<guid isPermaLink="false">223603@http://forum.nette.org/en</guid>
	<description>&lt;p&gt;Ок, now I don&apos;t use flash messages, but redirecting to port
&lt;strong&gt;:80&lt;/strong&gt; continues&lt;/p&gt;

&lt;p&gt;It happend after redirect function&lt;/p&gt;

&lt;pre
class=&quot;language-php&quot;&gt;&lt;code&gt;    protected function startup(): void
    {
        parent::startup();

        if (!$this-&amp;gt;getUser()-&amp;gt;isLoggedIn()) {
            $this-&amp;gt;redirect(&apos;Sign:in&apos;);
        }
    }&lt;/code&gt;&lt;/pre&gt;
</description>
	<pubDate>Tue, 02 May 2023 19:51:21 +0200</pubDate>
</item>
<item>
	<title>Redirecting to :80 port after authorization (Beginners)</title>
	<dc:creator>materix</dc:creator>
	<link>https://forum.nette.org/en/35893#p223602</link>
	<guid isPermaLink="false">223602@http://forum.nette.org/en</guid>
	<description>&lt;p&gt;The _fid parameter is used for flash messages. Flash messages are commonly
used to display success or error messages to users after they complete an
action, like submitting a form or logging in.&lt;/p&gt;

&lt;p&gt;You can just ignore it, and leave it as it is.&lt;/p&gt;
</description>
	<pubDate>Tue, 02 May 2023 19:29:35 +0200</pubDate>
</item>
<item>
	<title>Redirecting to :80 port after authorization (Beginners)</title>
	<dc:creator>iplague</dc:creator>
	<link>https://forum.nette.org/en/35893#p223600</link>
	<guid isPermaLink="false">223600@http://forum.nette.org/en</guid>
	<description>&lt;p&gt;Hello!&lt;/p&gt;

&lt;p&gt;Have next problem:&lt;br&gt;
after authorization redirecting &lt;strong&gt;:80/?_fid=q8b9&lt;/strong&gt; to this, what
doest it mean?&lt;/p&gt;
</description>
	<pubDate>Tue, 02 May 2023 18:56:27 +0200</pubDate>
</item>
</channel>
</rss>
