This is some sort of follow-up to the question: Compatibility of hypertexnames=false and indexes.
I will post Ulrike Fischer’s answer which shall now serve as MWE for this question:
\documentclass[index=totoc]{scrbook}
\usepackage{lipsum}
\usepackage{makeidx}
\makeindex
\usepackage[hypertexnames=false]{hyperref}
\makeatletter
\usepackage{etoolbox}
\patchcmd\Hy@EveryPageBoxHook{\Hy@EveryPageAnchor}{\Hy@hypertexnamestrue\Hy@EveryPageAnchor}{}{\fail}
\makeatother
\begin{document}
\frontmatter
\title{Title}
\maketitle
\mainmatter
\chapter{Chapter 1}
\label{chap1}
\index{BeginningChapter1}\lipsum\index{EndChapter1}
\chapter{Chapter 2}
\index{BeginningChapter2}\lipsum\index{EndChapter2}
\pageref{chap1}
\printindex
\end{document}
Albeit Ulrike Fischer warned that the option is »not much tested«, it also worked in every document I compiled until now (small and large): The page-references lead to correct page-numbers, and they are displayed correctly.
There is a new problem that arises: The absolute page number is still stored somewhere, and used in some PDF-readers and displayed when the cursor hovers over the reference. Two Screenshots from Okular and qpdfviewer (Adobe Acrobat Reader shows nothing, but I am using an old version with wine):
Any idea if this can be fixed hyperrefs means? (Another user encountered the same problem here under different circumstances. Loading hyperref first as suggested in the answer actually works for the MWE, but I am dependent to load hyperref after a few other packages in many documents.)


hypertexnames. A simpler MWE without index, with regular\usepackage{hyperref}and a\tableofcontentsshows the same behavior in Okular (i.e., the tooltip refers to the absolute page and not the displayed page number). In other viewers such as Evince the problem does not show, both the simple MWE as your MWE show the correct tooltip. – Marijn Aug 04 '20 at 16:55