You would usually change the application or site that generates the links, and have that add the /sandbox
to the URL.
If that's not possible, putting this into the web root directory (the one above /sandbox
) should do:
RewriteEngine on
Options +FollowSymlinks
RewriteCond %{REQUEST_URI} !^/sandbox # If URL does not start with /sandbox...
RewriteRule (.*) /sandbox/$1 # Add /sandbox/ in front of it
(if it's easier to achieve with Alias
, Apache Gurus, feel free to add your solution, but I couldn't get Alias to work for this scenario.)
However, this solution will make any other directory besides /sandbox
inaccessible. You may want to re-think your Virtual hosts structure!