• Apache .htaccess mod rewrite gurus?

    From Rick Christian@1:135/377 to All on Thu Feb 7 01:13:17 2019
    Hello everybody!

    Any one a guru with Apache .htaccess mod rewrite???

    I got some software which, php script, which I did not write, and it makes the decision that you will install in / and go fromt here, and be happy with that choice...

    Well as usual thats not an option for me, nor is rewriting this to change the codes hard references for CSS, images, etc.. to the install path....

    So why not mod rewrite to get Apache to do it automagically... right??

    Well I suck at regex, no, does not compute...

    So here goes...

    There is NO FQDN to this box. It is accessed via IP only. Period. I have no plans to change that or desire to..its my private box for a task. Doesn't need a domain...

    so I access thigns like:

    https://IP/dir/ goes to some software that I use on it... works great...

    https://ip/dir/dir2 is some other software, works great....

    https://ip/dir/dir3 is some other software WORKS, BUT with issues... hence the need to mod rewrite.

    I can FIX things MANUALLY by rewriting the URLS in the address to be: https://ip/dir/dir3 when the software spits out https://ip/some.php

    https://ip/ - HAS NOTHING there..

    If it matters.... https://ip/dir/ IS HTPASSWD protected, there is ONE user setup for this, mine. Thats why ip/ is blank... all the stuff I use on that box
    is in the password protected dir, and the run below that to ensure its udner password protection...

    So I whipped up some .htaccess for ip/dir/dir3 and doesn't seem to work, to fix
    the issue, or break anything. The problem script continues to behave as normal... after the first script loads from https:/ip/dir/dir3/ things are broken links, missing, css, missing images as obviously the hard coded paths are fubar'd.....

    This is what I've got so far, NO JOY.

    * ** ** * *
    RewriteEngine on
    RewriteBase /

    RewriteCond %{REQUEST_URI} !^/dir/dir3/

    # Rewrite all those to insert /folder
    RewriteRule ^(.*)$ /dir/dir3/$1 [L]

    * * * * * * *

    There is something I am missing in this or the lack of a FQDN is messing things
    ups, or the above is just plain broken, flat out wrong.

    Any one got the an idea????

    Hint: Moving this to the root dir, and passwrd this is NOT the desired outcome.. it might/likely removes the issue.. I WANT to KEEP / clean and empty... for my own reasons... mainly any bot that might crawls it finds nothing, (robot.txt etc. are present to deny spidering, but as we all know not all even certain large firms follow it!)



    ... NOprah!
    --- GoldED+/LNX 1.1.5-b20161221
    * Origin: Vina's Talos Moon Base Alpha (1:135/377)