diff --git a/templates/etherpadlite.vhost.erb b/templates/etherpadlite.vhost.erb index 6ac0aec..e9802a5 100644 --- a/templates/etherpadlite.vhost.erb +++ b/templates/etherpadlite.vhost.erb @@ -35,9 +35,25 @@ RewriteEngine on RewriteCond %{HTTP_HOST} !<%= scope.lookupvar("etherpad_lite::apache::vhost_name") %> - RewriteRule ^.*$ https://<%= scope.lookupvar("etherpad_lite::apache::vhost_name") %> - RewriteRule ^/(.*)$ http://localhost:9001/$1 [P] + RewriteRule ^.*$ https://<%= scope.lookupvar("etherpad_lite::apache::vhost_name") %> [L,R=301] + RewriteRule ^/p/(.*)$ https://<%= scope.lookupvar("etherpad_lite::apache::vhost_name") %>/$1 [NC,L,R=301] + RewriteCond %{REQUEST_URI} !^/p/ + RewriteCond %{REQUEST_URI} !^/static/ + RewriteCond %{REQUEST_URI} !^/pluginfw/ + RewriteCond %{REQUEST_URI} !^/javascripts/ + RewriteCond %{REQUEST_URI} !^/socket.io/ + RewriteCond %{REQUEST_URI} !^/ep/ + RewriteCond %{REQUEST_URI} !^/minified/ + RewriteCond %{REQUEST_URI} !^/api/ + RewriteCond %{REQUEST_URI} !^/ro/ + RewriteCond %{REQUEST_URI} !^/error/ + RewriteCond %{REQUEST_URI} !^/jserror + RewriteCond %{REQUEST_URI} !/favicon.ico + RewriteCond %{REQUEST_URI} !/robots.txt + RewriteRule ^/+(.+)$ https://<%= scope.lookupvar("etherpad_lite::apache::vhost_name") %>/p/$1 + + RewriteRule ^/(.*)$ http://localhost:9001/$1 [P] ProxyPassReverse / http://localhost:9001/