Missing .htaccess file in / #38
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I cloned the repository and installed BookStack using the manual install method here https://www.bookstackapp.com/docs/admin/installation/.
After installing following the instructions given, I get a file listing when going to APP_URL I have updated all of the settings in the .env file including the site URL. I am running MySQL Ver 5.7.39 and PHP 8.4
I noticed that there is no .htaccess file in the root folder providing a rewrite to the public folder. Could you provide the .htaccess file or the proper rewrite for the /.htaccess file so this redirects properly?
Also, I attempted to direct the browser to APP_URL/index.php and receive a file not found error. Please help me with a prompt and brief resolution to this issue. Thank you.
By the way, I need to use the .htaccess method as the vhost file is managed by WHM/cPanel and is not to be manually edited.
Hi @siteleas 👋 ,
Unfortunately not, BookStack does not support that style of setup.
As per step 7 of the manual install docs, The web root needs to point to the
publicfolder.The BookStack app files, outside of the
publicfolder, should never be within served web space as this risks additional exposure.It is possible to alter things to get it working in such a a setup, but it's not something I recommend or support due to the onset issues that can occur.
You should never need to access the app at
/index.php.As above.
I'm pretty sure it is possible to do on WHM/cPanel setups but it might depend on access and privileges.
I also have it in mind that maybe you can only set a custom "Web root" when using a secondary/sub domain in cPanel. Not sure if that's still the case though.
Thank you @ssddanbrown for your prompt reply! Totally appreciate your work on, and dedication to, this open source project. Good job 👍
Okay, you were right. There was a way to edit the document root for the sub-domain in cPanel. Once I did that, pointing the document root to the public folder, I received the following error:
No input file specified.Hard to know based upon that error alone.
Might be an issue with PHP not active on the current site. I noticed you mentioned using
PHP 8.4, but that's not something that currently exists. Might be worth PHP is active?Alternatively, might be that the
.htaccessis not being read, which is a common default as it's generally better to modify your webserver config instead. Or, could be that therewriteapache server extension is not installed/active.I was able to solve the problem by modifying the public/.htaccess file with the following change:
RewriteRule ^ index.php [L]to
RewriteRule ^(.*)$ index.php?/$1 [L]Alrighty, since you've got things working I'll close this off.
Note: Editing core app files may give you issues when it comes to running the update steps. You may need to revert/ignore your changes, upgrade, then re-apply them.