I am using revtex4-1 in a document with many short subsections (2-3 per page). Rather than the page number, I would like my index to refer to the section and subsection (i.e. "example, 2.1" for the item 'example' in section 2, subsection 1). The code below does everything I want, except there is no "." between the section and subsection numbers:
\documentclass[rmp]{revtex4-1}
\usepackage{makeidx}
\makeatletter
\def\@wrindex#1{%
\protected@write\@indexfile{}%
{\string\indexentry{#1}{\thesubsection}}
\endgroup
\@esphack}
\makeindex
\renewcommand{\thesection}{\arabic{section}}
\renewcommand{\thesubsection}{\arabic{section}\arabic{subsection}}
\begin{document}
\section{Section} This is Section 1
\subsection{Subsection} This is Subsection 1.1 \index{My Subsection}
\printindex
\end{document}
If I instead do \renewcommand{\thesubsection}{\arabic{section}.\arabic{subsection}, then the index will not print. I have seen workarounds such as this one, but this method only works for up to 9 subsections. How can I have the index print section.subsection?

.in the index entry – Feb 08 '17 at 18:11\thesubsectioninto a form that makeindex does understand? Or a way to change what makeindex can understand? – mtutor Feb 08 '17 at 18:15