-
Notifications
You must be signed in to change notification settings - Fork 36
Description
Is there a way to put BeansBooks into a subdirectory properly? I'm assuming it's going to require something in .htaccess but I'm stumped.
Goal: Instead of example.com. I want to access my BeansBooks instance at example.com/beansbooks. I've got Apache set up (alias config below), but when I got to example.com/beansbooks I just get a BeansBooks 404 page with no style and all the links and images point to /dash and /customers instead of /beansbooks/dash.
(The reason I want to do this is that I have an SSL certificate for mydomain.com and I put things like this in aliased subfolders so I can use the same SSL certificate for things like this and ownCloud.)
The best I could figure out is putting this right after the RewriteEngine On line: (but it's not working for me)
RewriteCond %{REQUEST_URI} !^/beansbooks
RewriteRule ^(/?)(.*) /beansbooks/$2
Here's my Apache alias file in my virtual host:
Alias /beansbooks /path/to/beansbooks
<Directory /path/to/beansbooks>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
This same Apache configuration works for MantisBT (bug tracker), ownCloud (cloud storage), LimeSurvey (surveys), phpmyadmin, and a bunch of other things, but for some reason BeansBooks insists on being at the root. When I put this exact same BeansBooks instance at the root of a domain (example2.com, same file system path and permissions) everything works flawlessly, so I know the files and database are all set up.
The reason I think a redirect in .htaccess is the correct answer for now is because many of the links are hard-coded, for instance the masthead_links in /application/classes/view/template.php.
I'm just a beginning programmer, but I think a long-term fix would be to make the links relative (for instance, have a config variable $root and add that to the beginning of all links that start with a backslash). If somebody smarter than me agrees, I can take some time and try to do that myself.
(On the other hand, am I way off-base with all of this?)