"Request exceeded the limit of 10 internal redirects" on new subdirectory install #4495

Closed
opened 2026-02-05 09:00:35 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @Mysterius on GitHub (Mar 4, 2024).

Describe the Bug

Hello,

I followed the installation instructions, and also the instructions from this page since I need to access BookStack in a subdirectory.

Whatever I do, I land on a styled BookStack page indicating an unkown error.
chrome_qINPl3zgJN

In the apache error logs, here is what I get :

[Mon Mar 04 16:07:02.489422 2024] [core:error] [pid 409711] [client xx.xx.xx.xx:27770] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: https://carte.domain.com/wiki/
[Mon Mar 04 16:07:02.489449 2024] [core:debug] [pid 409711] core.c(3956): [client xx.xx.xx.xx:27770] AH00121: r->uri = /wiki/public/index.php, referer: https://carte.domain.com/wiki/
[Mon Mar 04 16:07:02.489464 2024] [core:debug] [pid 409711] core.c(3962): [client xx.xx.xx.xx:27770] AH00122: redirected from r->uri = /wiki/public/index.php, referer: https://carte.domain.com/wiki/
[Mon Mar 04 16:07:02.489479 2024] [core:debug] [pid 409711] core.c(3962): [client xx.xx.xx.xx:27770] AH00122: redirected from r->uri = /wiki/public/index.php, referer: https://carte.domain.com/wiki/
[Mon Mar 04 16:07:02.489493 2024] [core:debug] [pid 409711] core.c(3962): [client xx.xx.xx.xx:27770] AH00122: redirected from r->uri = /wiki/public/index.php, referer: https://carte.domain.com/wiki/
[Mon Mar 04 16:07:02.489507 2024] [core:debug] [pid 409711] core.c(3962): [client xx.xx.xx.xx:27770] AH00122: redirected from r->uri = /wiki/public/index.php, referer: https://carte.domain.com/wiki/
[Mon Mar 04 16:07:02.489520 2024] [core:debug] [pid 409711] core.c(3962): [client xx.xx.xx.xx:27770] AH00122: redirected from r->uri = /wiki/public/index.php, referer: https://carte.domain.com/wiki/
[Mon Mar 04 16:07:02.489534 2024] [core:debug] [pid 409711] core.c(3962): [client xx.xx.xx.xx:27770] AH00122: redirected from r->uri = /wiki/public/index.php, referer: https://carte.domain.com/wiki/
[Mon Mar 04 16:07:02.489548 2024] [core:debug] [pid 409711] core.c(3962): [client xx.xx.xx.xx:27770] AH00122: redirected from r->uri = /wiki/public/index.php, referer: https://carte.domain.com/wiki/
[Mon Mar 04 16:07:02.489562 2024] [core:debug] [pid 409711] core.c(3962): [client xx.xx.xx.xx:27770] AH00122: redirected from r->uri = /wiki/public/index.php, referer: https://carte.domain.com/wiki/
[Mon Mar 04 16:07:02.489576 2024] [core:debug] [pid 409711] core.c(3962): [client xx.xx.xx.xx:27770] AH00122: redirected from r->uri = /wiki/public/index.php, referer: https://carte.domain.com/wiki/
[Mon Mar 04 16:07:02.489589 2024] [core:debug] [pid 409711] core.c(3962): [client xx.xx.xx.xx:27770] AH00122: redirected from r->uri = /wiki/manifest.json, referer: https://carte.domain.com/wiki/

My .env

APP_URL=https://carte.domain.com/wiki/

My full vhost

<VirtualHost *:443>
    ServerName carte.domain.com
	ServerAlias www.carte.domain.com
	DocumentRoot /home/user/www/carte
	
	SSLEngine on
	SSLCertificateFile      /etc/ssl/certs/cloudflare.pem
	SSLCertificateKeyFile   /etc/ssl/private/cloudflare.key
	
	ErrorLog ${APACHE_LOG_DIR}/carte-error-ssl.log
	CustomLog ${APACHE_LOG_DIR}/carte-access-ssl.log combined
	
	# BookStack Configuration
    Alias "/wiki" "/home/user/www/carte/wiki/public"

    <Directory "/home/user/www/carte/wiki/public">
      Options FollowSymlinks
      AllowOverride None
      Require all granted

      RewriteEngine On
      # Redirect Trailing Slashes If Not A Folder...
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule ^(.*)/$ /$1 [L,R=301]

      # Handle Front Controller...
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteRule ^ index.php [L]
    </Directory>


    <Directory "/home/user/www/carte/wiki">
      AllowOverride None
      Require all denied
    </Directory>
    # End BookStack Configuration
</VirtualHost>

I really can't wrap my head around what I did wrong. Someone on Reddit recently had a similar problem.

Steps to Reproduce

I followed the installation instructions, and also the instructions from this page since I need to access BookStack in a subdirectory.

Expected Behaviour

I should see the index page.

Screenshots or Additional Context

No response

Browser Details

No response

Exact BookStack Version

24.02

Originally created by @Mysterius on GitHub (Mar 4, 2024). ### Describe the Bug Hello, I followed the installation instructions, and also the instructions from [this page](https://www.bookstackapp.com/docs/admin/subdirectory-setup/#apache-setup) since I need to access BookStack in a subdirectory. Whatever I do, I land on a styled BookStack page indicating an unkown error. ![chrome_qINPl3zgJN](https://github.com/BookStackApp/BookStack/assets/4077266/acc398ce-f0b6-4a4d-a0fa-d153ed69b832) In the apache error logs, here is what I get : ``` [Mon Mar 04 16:07:02.489422 2024] [core:error] [pid 409711] [client xx.xx.xx.xx:27770] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: https://carte.domain.com/wiki/ [Mon Mar 04 16:07:02.489449 2024] [core:debug] [pid 409711] core.c(3956): [client xx.xx.xx.xx:27770] AH00121: r->uri = /wiki/public/index.php, referer: https://carte.domain.com/wiki/ [Mon Mar 04 16:07:02.489464 2024] [core:debug] [pid 409711] core.c(3962): [client xx.xx.xx.xx:27770] AH00122: redirected from r->uri = /wiki/public/index.php, referer: https://carte.domain.com/wiki/ [Mon Mar 04 16:07:02.489479 2024] [core:debug] [pid 409711] core.c(3962): [client xx.xx.xx.xx:27770] AH00122: redirected from r->uri = /wiki/public/index.php, referer: https://carte.domain.com/wiki/ [Mon Mar 04 16:07:02.489493 2024] [core:debug] [pid 409711] core.c(3962): [client xx.xx.xx.xx:27770] AH00122: redirected from r->uri = /wiki/public/index.php, referer: https://carte.domain.com/wiki/ [Mon Mar 04 16:07:02.489507 2024] [core:debug] [pid 409711] core.c(3962): [client xx.xx.xx.xx:27770] AH00122: redirected from r->uri = /wiki/public/index.php, referer: https://carte.domain.com/wiki/ [Mon Mar 04 16:07:02.489520 2024] [core:debug] [pid 409711] core.c(3962): [client xx.xx.xx.xx:27770] AH00122: redirected from r->uri = /wiki/public/index.php, referer: https://carte.domain.com/wiki/ [Mon Mar 04 16:07:02.489534 2024] [core:debug] [pid 409711] core.c(3962): [client xx.xx.xx.xx:27770] AH00122: redirected from r->uri = /wiki/public/index.php, referer: https://carte.domain.com/wiki/ [Mon Mar 04 16:07:02.489548 2024] [core:debug] [pid 409711] core.c(3962): [client xx.xx.xx.xx:27770] AH00122: redirected from r->uri = /wiki/public/index.php, referer: https://carte.domain.com/wiki/ [Mon Mar 04 16:07:02.489562 2024] [core:debug] [pid 409711] core.c(3962): [client xx.xx.xx.xx:27770] AH00122: redirected from r->uri = /wiki/public/index.php, referer: https://carte.domain.com/wiki/ [Mon Mar 04 16:07:02.489576 2024] [core:debug] [pid 409711] core.c(3962): [client xx.xx.xx.xx:27770] AH00122: redirected from r->uri = /wiki/public/index.php, referer: https://carte.domain.com/wiki/ [Mon Mar 04 16:07:02.489589 2024] [core:debug] [pid 409711] core.c(3962): [client xx.xx.xx.xx:27770] AH00122: redirected from r->uri = /wiki/manifest.json, referer: https://carte.domain.com/wiki/ ``` My .env ``` APP_URL=https://carte.domain.com/wiki/ ``` My full vhost ``` <VirtualHost *:443> ServerName carte.domain.com ServerAlias www.carte.domain.com DocumentRoot /home/user/www/carte SSLEngine on SSLCertificateFile /etc/ssl/certs/cloudflare.pem SSLCertificateKeyFile /etc/ssl/private/cloudflare.key ErrorLog ${APACHE_LOG_DIR}/carte-error-ssl.log CustomLog ${APACHE_LOG_DIR}/carte-access-ssl.log combined # BookStack Configuration Alias "/wiki" "/home/user/www/carte/wiki/public" <Directory "/home/user/www/carte/wiki/public"> Options FollowSymlinks AllowOverride None Require all granted RewriteEngine On # Redirect Trailing Slashes If Not A Folder... RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)/$ /$1 [L,R=301] # Handle Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] </Directory> <Directory "/home/user/www/carte/wiki"> AllowOverride None Require all denied </Directory> # End BookStack Configuration </VirtualHost> ``` I really can't wrap my head around what I did wrong. Someone on Reddit [recently had a similar problem](https://www.reddit.com/r/BookStack/comments/1arc4n0/cannot_get_bookstack_working_in_a_subdirectory/). ### Steps to Reproduce I followed the installation instructions, and also the instructions from [this page](https://www.bookstackapp.com/docs/admin/subdirectory-setup/#apache-setup) since I need to access BookStack in a subdirectory. ### Expected Behaviour I should see the index page. ### Screenshots or Additional Context _No response_ ### Browser Details _No response_ ### Exact BookStack Version 24.02
OVERLORD added the 🐕 Support label 2026-02-05 09:00:35 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Mar 4, 2024):

Hi @Mysterius,

BookStack is still being served within the directory of another site. I think this can cause unstable/odd behavior.
Try moving the BookStack install to a completely different folder, not part of any site.
So maybe to /home/user/www/bookstack, then update the paths to suit in the apache config.

@ssddanbrown commented on GitHub (Mar 4, 2024): Hi @Mysterius, BookStack is still being served within the directory of another site. I think this can cause unstable/odd behavior. Try moving the BookStack install to a completely different folder, not part of any site. So maybe to `/home/user/www/bookstack`, then update the paths to suit in the apache config.
Author
Owner

@Mysterius commented on GitHub (Mar 5, 2024):

Hi!

You were right, moving the bookstack directory to the web root worked.

It cannot fit my use case however, as I needed bookstack to be in a subdirectory of our current website for wonky PHP includes reasons I have no power about.

Thank you for your answer anyway as this should help other people in the future !

@Mysterius commented on GitHub (Mar 5, 2024): Hi! You were right, moving the bookstack directory to the web root worked. It cannot fit my use case however, as I needed bookstack to be in a subdirectory of our current website for wonky PHP includes reasons I have no power about. Thank you for your answer anyway as this should help other people in the future !
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#4495