diff --git a/web/html2x.pl b/web/html2x.pl
index 43218682d..86f71196e 100755
--- a/web/html2x.pl
+++ b/web/html2x.pl
@@ -19,7 +19,7 @@ if ($format =~ /^markdown\+$/) {
 }
 
 # Validate URL and format
-unless ($url =~ /^(https?:\/\/)?[\w#_-]+(\.[\w#_-]+)+[\w\/#=?_.-]*$/) {
+unless ($url =~ /^(https?:\/\/)?[\w#_-]+(\.[\w#_-]+)+(:\d+)?[\w\/#=:?_.-]*$/) {
   die "Illegal URL: $url\n" ;
 }
 unless ($format =~ /^markdown\+?|rst|latex|context|rtf|man|docbook$/) {