desbest
I've got it all figured out. I most definitely did still need the following in my dokuwiki.conf (VirtualHost) file:
<VirtualHost *:80>
ServerName sub.domain.com
ServerAlias sub.domain.com
Redirect permanent / https://sub.domain.com/
</VirtualHost>
But what's important here is the "/" at the end: Redirect permanent / https://sub.domain.com/
Without that forward slash, if I was to go to, say, http://sub.domain.com/start
(because I have Nice URL's now) to see if it redirects to http, it wouldn't find it because it would say that https://sub.domain.comstart
doesn't exist. And indeed it doesn't. So I realized that I also needed the slash at the end of the domain.
So anyways, I think everything is good now. Thanks for your help!
Additionally, I also added (to the .htaccess file):
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}/$1 [R,L]
because apparently they're needed for forcing login via https? The wiki that I created is private and so the user must be logged in to view any of it. Is this correct and needed in my case?
Also, I made sure the rules that you told me to insert were placed right after:
## Uncomment these rules if you want to have nice URLs using
## $conf['userewrite'] = 1 - not needed for rewrite mode 2
RewriteEngine on