I've been through all tagged questions here and on SO, but my problem is different because of either/both needing to replace ".
" with "_
" comes after a particular path and I'm running through a proxypass
.
I am trying to change:
http://somedomainname.com/grafana/dashboard/db/generic-ping?var-device=SF-some.machinename.com
to:
http://somedomainname.com/grafana/dashboard/db/generic-ping?var-device=SF-some_machinename_com
Code:
Options +FollowSymLinks
RewriteEngine On
ProxyPreserveHost On
ProxyPass /grafana http://100.65.7.97:3000
ProxyPassReverse /grafana http://100.65.7.97:3000
I've tried many things after hours of scouring serverfault/stackoverflow/webmasters.stackexchange/google etc. But nothing I try is successfully redirecting. I'm not sure why.
Some of the things I've tried (and variations on them):
RewriteRule ^([^\.]*)\ (.*)$ $1_$2 [E=%E2:yes,N]
RewriteCond %{ENV:%E2} yes
RewriteRule (.*) http://%{HTTP_HOST}$1 [R=301,L]
...
RewriteRule ^(/?grafana/dashboard/db/.*/[^/]*?).([^/]*?.[^/]*)$ $1_$2 [N]
RewriteRule ^(/?grafana/dashboard/db/.*/[^/]*?).([^/.]*)$ $1_$2 [R=301]
...
RewriteCond %{REQUEST_URI} ^(.*).(.*).(.*)/$
RewriteRule (.*).(.*).(.*)/ http://somedomainname.com/grafana/dashboard/db/$1_$2_$3/ [R=301]
...and many others...
Could this be an issue because I'm also using proxypass
? Maybe I'm just overlooking something simple? Any help is appreciated.