I try to create a config in apache server that will transfer the url
foo.bar/baz/hq
to
foo.bar/baz#a=1;b=2;c=3
where baz can be anything.
I tried this (see https://stackoverflow.com/a/8606198/3475778)
RewriteRule ^([A-Za-z0-9-]+)/hq$ $1#foo=bar [NC,NE,R=302]
but somehow the redirect doesnt seem to work and I do not know why.
My conf file looks like this - sorry it is a bit messy, I am not a sysadmin.
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName xxx
Redirect 302 / http://xxx/
SSLCertificateFile /etc/letsencrypt/live/xxx/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/xxx/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName xxx
ErrorLog /var/log/apache2/xxx.net-error.log
RewriteEngine on
RewriteRule ^([A-Za-z0-9-]+)/hq$ $1#foo=bar [NC,NE,R=302]
ProxyPass "/" "http://localhost:8000/"
ProxyPassReverse "/" "http://localhost:8000/"
ProxyPass "/http-bind" "http://localhost:8000/http-bind/"
ProxyPassReverse "/http-bind" "http://localhost:8000/http-bind"
RewriteEngine on
# Some rewrite rules in this file were disabled on your HTTPS site,
# because they have the potential to create redirection loops.
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteCond %{HTTP:Connection} upgrade [NC]
RewriteRule ^/?(.*) "ws://localhost:8000/$1" [P,L]
SSLCertificateFile /etc/letsencrypt/live/xxx/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/xxx/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>