apache2 500 error on localhost/~username/index.html

Apache tosses a 500 error when typing localhost/~username/index.html. (Note that “username” is the actually the real user name.)

Typing localhost into the browser displays the “It Works” page, so Apache2 is working.
Typing localhost/index.html displays the webpage in created and copies to /srv/www/htdocs/index.html.
I created a page index.php that calls phpinfo. Typing localhost/index.php displays a page with the php configuration, so PHP7 is working.

localhost/~username/index.html was working and is not working anymore.

I tried to fix the problem by renaming the directory /etc/apache2 to /etc/apache2_old. I reloaded/reinstalled apache2 with YaST. This created a new /etc/apache2 folder. This did not resolve the problem.

I think this is an aliasing problem, although I am using the default alias setup.

Any help would be appreciated. Thanks.

Unless you create a virtual directory, all your html files should be placed within the web root of the website (you’re pointing to a location elsewhere, not in the web root).

Depending on why you want to view html pages in a custom location,
You should know that Web Developers find it very cumbersome to play by the strict rules setting up a big, Apache web server.
If you just want a quick look at html files rendered as a web page, you can do what Developers do and launch a lightweight webserver which can point to files anywhere on your system instead of using Apache.

Practically all development languages (particularly scripting languages) support launching small, impromptu web servers (eg python, ruby, NodeJS, etc).

My personal favorite is NodeJS, all you need to do is install nodejs in your system and then run a small script, one way (of zillions) is described in my Wiki

https://en.opensuse.org/User:Tsu2/NodeJs_http_servers

As described, it only displays html files but you can extend to support PHP and similar as well.

TSU

Problem fixed. My bad.
I inadvertently had a .htaccess file on the public_html directory. After removing it, everything works as expected.