2

I am configuring an apache server to change URLs from [http://(IP)/users/testuser/test.html] to [http:/(IP)/~testuser/test.html]

This works fine, as such

RewriteEngine On  
RewriteRule ^/users/(.*)$ /~\$1 [R]

However when someone does [https://(IP)/users/testuser/test.html] it does not change it to [https:/(IP)/~testuser/test.html]

Any suggestions?

roger34
  • 55

2 Answers2

1

You have to add the rule to a virtual host directive in the ssl.conf file instead of where you were trying to put it.

slhck
  • 235,242
0

I added below in default-ssl.conf and it worked.

<Directory /var/www/html> #Your directory path
  Options Indexes FollowSymLinks
  AllowOverride All
  Require all granted
</Directory>