Logon redirects to wrong URL when using a different base URL #2147

Closed
opened 2026-02-05 03:06:13 +03:00 by OVERLORD · 6 comments
Owner

Originally created by @chrisnewmanuk on GitHub (Mar 8, 2021).

Describe the bug
A clear and concise description of what the bug is.

Steps To Reproduce
Steps to reproduce the behavior:

  1. Setup base URLs with a sub dir
  2. Login
  3. Goes to https://domain/sub/sub rather than https://domain/sub

Screenshots
Wrong sub dir location immediately after logon:
image

Works fine at the right sub dir location:
image

Your Configuration (please complete the following information):
latest.
baseurl is https://domain:8080/docs

Additional context
Add any other context about the problem here.

Originally created by @chrisnewmanuk on GitHub (Mar 8, 2021). **Describe the bug** A clear and concise description of what the bug is. **Steps To Reproduce** Steps to reproduce the behavior: 1. Setup base URLs with a sub dir 2. Login 3. Goes to https://domain/sub/sub rather than https://domain/sub **Screenshots** Wrong sub dir location immediately after logon: ![image](https://user-images.githubusercontent.com/7243321/110311073-32290500-7ffb-11eb-9418-14b0721ca7cd.png) Works fine at the right sub dir location: ![image](https://user-images.githubusercontent.com/7243321/110311209-5d135900-7ffb-11eb-8e25-0cc0b9babd1d.png) **Your Configuration (please complete the following information):** latest. baseurl is https://domain:8080/docs **Additional context** Add any other context about the problem here.
OVERLORD added the :cat2:🐈 Possible duplicate label 2026-02-05 03:06:13 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Mar 9, 2021):

Thanks for the request @chrisnewmanuk.

I think #1377 and #2058 cover the same reported issue, both of which have been assigned to the next release. Therefore I'll close this off as a duplicate but if you continue to have problems after the next feature release feel free to re-create/open.

@ssddanbrown commented on GitHub (Mar 9, 2021): Thanks for the request @chrisnewmanuk. I think #1377 and #2058 cover the same reported issue, both of which have been assigned to the next release. Therefore I'll close this off as a duplicate but if you continue to have problems after the next feature release feel free to re-create/open.
Author
Owner

@ShuffleBox commented on GitHub (May 5, 2021):

Should this issue have been resolved by (including before) the BookStack v21.04.3 release, or one upcoming?

@ShuffleBox commented on GitHub (May 5, 2021): Should this issue have been resolved by (including before) the BookStack v21.04.3 release, or one upcoming?
Author
Owner

@prbt2016 commented on GitHub (May 17, 2021):

Hello @ssddanbrown

I am also facing the same issue in Bookstack version 21.04.5 while installing in a subdirectory on Centos 6.9 Final with Apache 2.2, PHP 7.3, MYSQL 5.7.

After following the steps mentioned here :

https://www.bookstackapp.com/docs/admin/installation/

Post installation, on hitting admin URL i.e :

http://example.com/manual/bookstack/public/login

and after entering default admin details i.e admin email and admin password, the page is being redirected to wrong url i.e :

http://example.com/manual/bookstack/public/manual/bookstack2104/public

Is there any way or fix to resolve this?.

@prbt2016 commented on GitHub (May 17, 2021): Hello @ssddanbrown I am also facing the same issue in Bookstack version 21.04.5 while installing in a subdirectory on Centos 6.9 Final with Apache 2.2, PHP 7.3, MYSQL 5.7. After following the steps mentioned here : https://www.bookstackapp.com/docs/admin/installation/ Post installation, on hitting admin URL i.e : http://example.com/manual/bookstack/public/login and after entering default admin details i.e admin email and admin password, the page is being redirected to wrong url i.e : http://example.com/manual/bookstack/public/manual/bookstack2104/public Is there any way or fix to resolve this?.
Author
Owner

@ssddanbrown commented on GitHub (May 17, 2021):

@prbt2016 If you've uploaded BookStack into the subdirectory of another website then it'll likely be insecure and not something we support.

BookStack can still be used at a "subdirectory" of a URL (eg. https://example.com/manual) but it has to be done via proxies or alias or similar, as described here for example. You can't just copy the files into an existing site. The abilities to set this up may depend on your hosting.

@ssddanbrown commented on GitHub (May 17, 2021): @prbt2016 If you've uploaded BookStack into the subdirectory of another website then it'll likely be insecure and not something we support. BookStack can still be used at a "subdirectory" of a URL (eg. https://example.com/manual) but it has to be done via proxies or alias or similar, [as described here for example](https://www.bookstackapp.com/docs/admin/subdirectory-setup/). You can't just copy the files into an existing site. The abilities to set this up may depend on your hosting.
Author
Owner

@prbt2016 commented on GitHub (May 22, 2021):

@ssddanbrown I tried installing Bookstack 21.04.5 in root directory of website as well i.e http://example.com.

However get the same issue after logging in i.e the URL redirects to :

http://example.com/public/public

In .env file I have set up my APP_URL to :

APP_URL=http://example.com/public

Is there any way by which Bookstack can be configured without VirtualHost setup as I am using shared hosting and don't have access to Apache configuration.

Is Bookstack compatible with shared hosting?

@prbt2016 commented on GitHub (May 22, 2021): @ssddanbrown I tried installing Bookstack 21.04.5 in root directory of website as well i.e http://example.com. However get the same issue after logging in i.e the URL redirects to : http://example.com/public/public In .env file I have set up my APP_URL to : `APP_URL=http://example.com/public` Is there any way by which Bookstack can be configured without VirtualHost setup as I am using shared hosting and don't have access to Apache configuration. Is Bookstack compatible with shared hosting?
Author
Owner

@ssddanbrown commented on GitHub (May 22, 2021):

Is there any way by which Bookstack can be configured without VirtualHost setup as I am using shared hosting and don't have access to Apache configuration.

Is Bookstack compatible with shared hosting?

@prbt2016 Not really. It's likely possible by editing files or using a more complex htaccess configuration but not something I'll support by default or encourage. It's too easy to get things wrong and result in an insecure setup.

@ssddanbrown commented on GitHub (May 22, 2021): > Is there any way by which Bookstack can be configured without VirtualHost setup as I am using shared hosting and don't have access to Apache configuration. > Is Bookstack compatible with shared hosting? @prbt2016 Not really. It's likely possible by editing files or using a more complex htaccess configuration but not something I'll support by default or encourage. It's too easy to get things wrong and result in an insecure setup.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#2147