Because of the way doxygen works there is no way to have the same lines of comment be in both the file description and the main page. As the poster states if it is directly under \file
it goes in the file description; if it is under \mainpage
it goes in the main page.
If you want the same text to appear in multiple places it has to be copied, which is possible using e.g. the \copydoc
command. /** \mainpage \copydoc myfile.cpp */
would copy the \file
comment from myfile.cpp
to the main page.