SamuelTallet/MongoDB-PHP-GUI

Bad redirect - Weird layout

Closed this issue · 3 comments

Hi could you please explain how can I install and serve the application from a subfolder?
Instead of serving the application from http://domain.com, I would like to serve it from http://domain.com/mongodb.

I'm trying to create a Docker image, for which you can configure the basepath.
The Dockerfile I'm using is:

FROM registry.hub.docker.com/library/php:7.4.16-apache-buster

COPY docker-entrypoint.sh /docker-entrypoint.sh

ENV VERSION="v1.1.0"
WORKDIR /var/www/html
RUN \
    apt-get update && \
    apt-get install -y build-essential git unzip && \
    pecl install mongodb-1.8.2 && \
    docker-php-ext-enable mongodb && \
    curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer && \
    a2enmod rewrite

CMD ["bash", "/docker-entrypoint.sh"]

and docker-entrypoint.sh is

#!/usr/bin/env bash

if [ ! -f /initialized ]; then
  echo "Installing into ${PWD}"
  git clone https://github.com/SamuelTS/MongoDB-PHP-GUI.git .
  git checkout "tags/${VERSION}" -b "${VERSION}"
  composer install
  touch /initialized
fi

apache2-foreground

I think I'm missing something in the rewrite rules for Apache, but unfortunately this is not my area of expertise and I can't properly debug the issue.

With the current rewrite rules if I access http://domain.com/mongodb/login# everything works as expected, but if I access http://domain.com/mongodb I get redirected to http://domain.com/mongodb//index/login# and everything is broken.

Could you provide some guidance?

Thanks in advance.

Hi. Sorry, I don't know enough Apache to help you.
One workaround could be to put MongoDB PHP GUI at root of a subdomain.

Hello. I've released a fix a few minutes ago... Please upgrade to latest version, then tell me if it helps.

If issue persists after upgrade: post a comment.