The bis-(3′-5′)-cyclic dimeric guanosine monophosphate (c-di-GMP) signaling pathway regulates biofilm formation, virulence, and other processes in many bacterial species and is critical for their survival. Two classes of c-di-GMP-binding riboswitches have been discovered that bind this second messenger with high affinity and regulate diverse downstream genes, underscoring the importance of RNA receptors in this pathway. We have solved the structure of a c-di-GMP-II riboswitch, which reveals that the ligand is bound as part of a triplex formed with a pseudoknot. The structure also shows that the guanine bases of c-di-GMP are recognized through noncanonical pairings and that the phosphodiester backbone is not contacted by the RNA. Recognition is quite different from that observed in the c-di-GMP-I riboswitch, demonstrating that at least two independent solutions for RNA second messenger binding have evolved. We exploited these differences to design a c-di-GMP analog that selectively binds the c-di-GMP-II aptamer over the c-di-GMP-I RNA. There are several bacterial species that contain both types of riboswitches, and this approach holds promise as an important tool for targeting one riboswitch, and thus one gene, over another in a selective fashion.