it-tools
it-tools copied to clipboard
[OTHER] how to set a subpath like "example.com/it_tool/xxxx"
how to set a subpath like "example.com/it_tool/xxxx"
and i
I found a workaround with apache2 (same configuration could be implemented in nginx), basically you need to do some rewrites, but would be nice if BASEPATH can be implemented as part of configuration.
Redirect 301 "/it-tools" "/it-tools/"
<Location /it-tools/>
ProxyPreserveHost On
ProxyPass http://localhost:9070/ retry=0 timeout=5
ProxyPassReverse http://localhost:9070/
RequestHeader set Connection ""
AddOutputFilterByType INFLATE;SUBSTITUTE text/html application/javascript
SubstituteMaxLineLength 500K
Substitute "s|href=\"|href=\"/it-tools/|inq"
Substitute "s|src=\"|src=\"/it-tools|inq"
Substitute "s|\"assets/|\"it-tools/assets/|inq"
Substitute "s|to:\"/\",class:\"hero-wrapper\"|to:\"/it-tools/\",class:\"hero-wrapper\"|inq"
</Location>
You can find example here: https://sitnikov.eu/it-tools/ It is not perfect:
- Main page shows 404 instead of "main page", but if you click on "home" it will be fine.
- URL will be updated without basepath, but in a fact all scripts are loaded from the correct place.
same request