<?xml version="1.0" encoding="windows-1252"?>
<node id="1014375" title="Re^2: Perlmonks 'Not logged in Error' - Proposal for fix (link render)" created="2013-01-20 22:35:13" updated="2013-01-20 22:35:13">
<type id="11">
note</type>
<author id="779185">
tmharish</author>
<data>
<field name="doctext">
&lt;blockquote&gt;
If such a redirection is implemented, then the destination page probably also needs to re-issue a cookie
&lt;/blockquote&gt;

&lt;p&gt;
If we did this server side then anyone landing on perlmonks.org would get redirected to www.perlmonks.org and no one would ever login on perlmonks.org. We could make this a 301 permanent redirect. 
&lt;/p&gt;

&lt;blockquote&gt;
I tend to prefer to fix the rendering over changing the text that users have entered. It automatically fixes old nodes and getting it wrong in some way doesn't leave garbage saved that then has to be found and cleaned up.
&lt;/blockquote&gt;

&lt;p&gt;
The only problem with this &lt;i&gt;could&lt;/i&gt; be the additional load on the server. For each page rendered the code will have to additionally check :
&lt;/p&gt;

&lt;code&gt;
$node_contents =~ s/(http:\/\/)?(www\.)?(perlmonks\.)(org|net|com)\/(.*)/$1www.perlmonks.$4\/$5/g;
&lt;/code&gt;

    </field>
<field name="root_node">
1014265</field>
<field name="parent_node">
1014305</field>
</data>
</node>
