e.g.
wpinstance.com/wp-admin
is not rewritten intowp-admin/
with a trailing slash, but into ugly long link:https://wpinstance.com/wp-login.php?redirect_to=https%3A%2F%2Fwpinstance.com%2Fwp-admin%2F&reauth=1
As is already mentioned in comments, this is intentional. There is no “pretty” URL for this. And neither does there need to be – this should not be indexed or linked to.
do I need
.htaccess
?
No, you don’t “need” .htaccess
.
If you have access to the server config, then you can paste these directives verbatim inside the <Directory /var/www/wpinstance/>
container (inside the <VirtualHost *:443>
container).
However, to paste those directives directly inside the <VirtualHost>
container you would need to make several changes, since mod_rewrite behaves differently in a server context (as opposed to a directory or .htaccess
context).
Note that everytime you make changes to the server config then you will need to restart Apache. You don’t need to restart Apache when you change the .htaccess
file.
I would also consider disabling MultiViews
– unless you specifically require this for something? ie. Remove MultiViews
from the Options
directive. (MultiViews can conflict with mod_rewrite – depends what you are doing.)
If you are not going to use .htaccess
files then they should be disabled:
AllowOverride None
UPDATE:
I’m using Apache/2.4.18
Note that the Order
and Allow
directives are deprecated in Apache 2.4, and will be removed in future versions. You need to change the following (Apache 2.2 and earlier) directives:
Order allow,deny Allow from all
to read:
Require all granted
in Apache 2.4+