diff --git a/html/cgi-bin/logs.cgi/ids.dat b/html/cgi-bin/logs.cgi/ids.dat
index 98176d690..5aef53499 100644
--- a/html/cgi-bin/logs.cgi/ids.dat
+++ b/html/cgi-bin/logs.cgi/ids.dat
@@ -336,7 +336,14 @@ print <<END
 END
 	;
 	if ($sid ne "n/a") {
-		print "<a href='https://www.snort.org/rule_docs/$sid' ";
+		# Link to sourcefire if the the rule sid is less than 1000000.
+		if ($sid lt 1000000) {
+			print "<a href='https://www.snort.org/rule_docs/1-$sid'";
+		# Link to emergingtreads if the rule sid is between 2000000 and 3000000.
+		} elsif (($sid gt 2000000) && ($sid lt 3000000)) {
+			print "<a href='http://doc.emergingthreats.net/$sid'";
+		}
+		# Close html tag for hyperlink.
 		print "target='_blank'>$sid</a></td>\n";
 	} else {
 		print $sid;
