<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Maurizio Domba Cerin</title>
    <description>The latest articles on DEV Community by Maurizio Domba Cerin (@mdomba).</description>
    <link>https://dev.to/mdomba</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4280735%2Fa43d0460-92e7-49dc-8b2e-50ca1a2778e2.jpg</url>
      <title>DEV Community: Maurizio Domba Cerin</title>
      <link>https://dev.to/mdomba</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mdomba"/>
    <language>en</language>
    <item>
      <title>Redesigning WanIP.info: two new tools, one simple homepage</title>
      <dc:creator>Maurizio Domba Cerin</dc:creator>
      <pubDate>Thu, 03 Dec 2026 13:34:58 +0000</pubDate>
      <link>https://dev.to/mdomba/redesigning-wanipinfo-two-new-tools-one-simple-homepage-5148</link>
      <guid>https://dev.to/mdomba/redesigning-wanipinfo-two-new-tools-one-simple-homepage-5148</guid>
      <description>&lt;p&gt;Most people open &lt;a href="https://wanip.info/" rel="noopener noreferrer"&gt;WanIP.info&lt;/a&gt; for one reason: to see their public IP address. I wanted to make the site more useful without making that job take any longer. So the IP is still the first thing you see, with a Copy IP button next to it. The network, reverse hostname when available, and browser details are there if you need them.&lt;/p&gt;

&lt;p&gt;I kept one thing from the old design just because I liked it: the little CSS wave in the WanIP logo. The page shows a static version when you've asked your browser to reduce motion.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tool 1: Did my public IP change?
&lt;/h2&gt;

&lt;p&gt;I nearly added a box where you could paste an old address to compare it with the current one. But if you already have both addresses in front of you, the site isn't doing much for you. The useful part is remembering the first address while you do something that might change it.&lt;/p&gt;

&lt;p&gt;On the &lt;a href="https://wanip.info/ip-change.php" rel="noopener noreferrer"&gt;IP-change checker&lt;/a&gt;, click &lt;strong&gt;Save this IP&lt;/strong&gt;, then switch networks or turn your VPN on or off. Click &lt;strong&gt;Check again&lt;/strong&gt; in the same tab. The saved address stays in that tab, and you can see whether WanIP now sees a different one. That's a before-and-after check, not a VPN leak test.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tool 2: Look up another IP address
&lt;/h2&gt;

&lt;p&gt;The homepage shows the address WanIP sees for your current connection. Sometimes you have a different address you want to check, perhaps one you saved earlier. The lookup takes an IPv4 or IPv6 address and shows its approximate country and network, where available. It won't tell you who's using that address or pinpoint their location.&lt;/p&gt;

&lt;h2&gt;
  
  
  Get the IP on screen first
&lt;/h2&gt;

&lt;p&gt;PHP sends the public IP in the first HTML response, so visitors don't have to wait for JavaScript to see it. The script for Copy IP loads with &lt;code&gt;defer&lt;/code&gt;, so it doesn't block the browser from parsing the page.&lt;/p&gt;

&lt;h2&gt;
  
  
  A small PHP tip: show help when it applies
&lt;/h2&gt;

&lt;p&gt;WanIP only shows &lt;strong&gt;Why am I seeing IPv6?&lt;/strong&gt; when the visitor's own connection uses IPv6. Here's a simplified example. &lt;code&gt;$lookup&lt;/code&gt; is true when someone has entered a different address to look up, and &lt;code&gt;$ip&lt;/code&gt; is the address being displayed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="n"&gt;php&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nv"&gt;$lookup&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nf"&gt;filter_var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$ip&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;FILTER_VALIDATE_IP&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;FILTER_FLAG_IPV6&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;?&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;details&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;summary&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nc"&gt;Why&lt;/span&gt; &lt;span class="n"&gt;am&lt;/span&gt; &lt;span class="no"&gt;I&lt;/span&gt; &lt;span class="n"&gt;seeing&lt;/span&gt; &lt;span class="nc"&gt;IPv6&lt;/span&gt;&lt;span class="o"&gt;?&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;summary&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nc"&gt;This&lt;/span&gt; &lt;span class="n"&gt;connection&lt;/span&gt; &lt;span class="n"&gt;used&lt;/span&gt; &lt;span class="nc"&gt;IPv6&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt; &lt;span class="nc"&gt;Your&lt;/span&gt; &lt;span class="n"&gt;network&lt;/span&gt; &lt;span class="n"&gt;may&lt;/span&gt; &lt;span class="n"&gt;also&lt;/span&gt; &lt;span class="n"&gt;have&lt;/span&gt; &lt;span class="nc"&gt;IPv4&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;details&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="n"&gt;php&lt;/span&gt; &lt;span class="k"&gt;endif&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="o"&gt;?&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;PHP decides whether the help belongs on the page. The browser's built-in &lt;code&gt;&amp;lt;details&amp;gt;&lt;/code&gt; handles opening and closing it without another script.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I left off the homepage
&lt;/h2&gt;

&lt;p&gt;I tried adding a few website-hosting guides. They were useful on their own, but they didn't answer the questions people came to WanIP with, so I took them off the homepage. The router guide stayed because it answers a question that comes up right after checking your IP: &lt;strong&gt;Why does my router show a different address?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That was the test I ended up using for every addition: would this help someone &lt;em&gt;right after&lt;/em&gt; they check their IP? If not, it probably doesn't belong on the homepage.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Hosting disclosure: WanIP.info runs on shared hosting from &lt;a href="https://supremecenterhost.com/" rel="noopener noreferrer"&gt;SupremeCenterHost&lt;/a&gt;, my reseller storefront. I may earn a commission if you purchase through it.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Writing disclosure: This case study was drafted with ChatGPT based on the actual redesign.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>php</category>
      <category>webdev</category>
      <category>showdev</category>
    </item>
    <item>
      <title>How I moved Plupy from static HTML to PHP without breaking its links</title>
      <dc:creator>Maurizio Domba Cerin</dc:creator>
      <pubDate>Thu, 03 Dec 2026 13:25:11 +0000</pubDate>
      <link>https://dev.to/mdomba/how-i-moved-plupy-from-static-html-to-php-without-breaking-its-links-5dd3</link>
      <guid>https://dev.to/mdomba/how-i-moved-plupy-from-static-html-to-php-without-breaking-its-links-5dd3</guid>
      <description>&lt;p&gt;&lt;a href="https://plupy.com/" rel="noopener noreferrer"&gt;Plupy&lt;/a&gt; started as a small collection of free activities for kids. Each activity had its own HTML file. That got the site online quickly, but adding an activity meant touching more than one page: the activity itself, the full list, and sometimes the homepage.&lt;/p&gt;

&lt;p&gt;I wanted to edit the activity in one place. I also wanted a link like &lt;a href="https://plupy.com/paper-bridge-lab.html" rel="noopener noreferrer"&gt;Paper Bridge Lab&lt;/a&gt; to keep working exactly as before. People had already shared links to the activities. They didn't need to know I was changing how the pages were built.&lt;/p&gt;

&lt;h2&gt;
  
  
  One catalogue, a few templates
&lt;/h2&gt;

&lt;p&gt;I moved the activity data into a JSON catalogue and used PHP to render it with shared templates. The activity title and age range now come from the same data whether you're on the homepage, in the activity list, or on an activity page. The homepage always leads with the Vanishing Party Hat and rotates the other two picks. The age filter only offers ages covered by at least one activity.&lt;/p&gt;

&lt;p&gt;A database would have given me a way to edit content through an admin screen, but I wasn't building one. For a small catalogue I edit myself, a single data file is enough.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep the old URL and change what serves it
&lt;/h2&gt;

&lt;p&gt;On Apache with &lt;code&gt;mod_rewrite&lt;/code&gt; and &lt;a href="https://httpd.apache.org/docs/2.4/rewrite/htaccess.html" rel="noopener noreferrer"&gt;rewrite rules enabled for the site&lt;/a&gt;, a root &lt;code&gt;.htaccess&lt;/code&gt; can send an old URL to a PHP file without redirecting the browser. Here's a simplified example for one page, not Plupy's production configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;RewriteEngine On
RewriteRule ^paper-bridge-lab\.html$ activity.php [L]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With a simple &lt;code&gt;activity.php&lt;/code&gt; in the same directory, requesting &lt;code&gt;/paper-bridge-lab.html&lt;/code&gt; runs that file. No &lt;code&gt;[R]&lt;/code&gt; flag, no new address in the browser. For this one-page example, &lt;code&gt;activity.php&lt;/code&gt; can just contain &lt;code&gt;&amp;lt;?php echo 'Paper Bridge Lab';&lt;/code&gt;. Plupy uses shared rendering for the catalogue rather than writing one PHP file per activity.&lt;/p&gt;

&lt;p&gt;The exact match matters. It leaves CSS, PDFs, and unrelated URLs alone. If you expand the rule into an activity router, look the slug up in the catalogue and return a real HTTP 404 when it isn't there. Don't build a PHP include path from the incoming slug.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd check before deleting any old files
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Open a shared link directly.&lt;/strong&gt; Start with a real activity URL such as &lt;code&gt;/paper-bridge-lab.html&lt;/code&gt;. Check the status as well as the page: it should be a 200, with no redirect to a new URL.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check the bits a 200 can't tell you.&lt;/strong&gt; Open the activity list, try an age filter, follow an activity link and open its printable. Make sure a made-up activity URL still returns 404.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keep a rollback you can actually use.&lt;/strong&gt; Once you've deleted the old HTML files, undoing the rewrite isn't enough. Keep a complete copy of the old pages and the matching configuration so you can restore both together.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;My biggest takeaway was that changing templates and changing URLs are two separate decisions. I had a good reason to change the first and no reason to change the second.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Hosting disclosure: Plupy runs on shared hosting from &lt;a href="https://supremecenterhost.com/" rel="noopener noreferrer"&gt;SupremeCenterHost&lt;/a&gt;, my reseller storefront. I may earn a commission if you purchase through it. The example uses ordinary Apache and PHP features and isn't specific to that host.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;AI disclosure: This case study was drafted with ChatGPT based on the actual Plupy migration.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>php</category>
      <category>webdev</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
