Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Root URL includes unnecessary slash when installed in subfolder, how to remove it? #317

Closed
yutakatsuchida opened this issue Apr 4, 2023 · 3 comments

Comments

@yutakatsuchida
Copy link

Hello

I recently installed Slim-Skeleton to a subfolder on my domain, located at mydomain.com/skeleton. However, I have noticed that when I try to access this URL, it automatically redirects to mydomain.com/skeleton/ with a trailing slash at the end. This behavior is causing some issues for my project, and I would like to remove the slash from the end of the URL.

Can anyone provide guidance on how to remove the trailing slash from the root URL when Slim-Skeleton is installed in a subfolder? Any help would be greatly appreciated. Thank you!

@eugene-borovov
Copy link

@yutakatsuchida
Copy link
Author

Hello @eugene-borovov,

Thank you for the reference. I tested it but I got the following error on my browser.

This page isn’t workingtuma.jp redirected you too many times.
ERR_TOO_MANY_REDIRECTS

Is there something wrong with the following two .htaccess files?

/skeleton/.htaccess

RewriteEngine On
RewriteBase /skeleton
RewriteRule (.*) public/$1 [L]

/skeleton/public/.htaccess

<IfModule mod_rewrite.c>
RewriteEngine On

RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
RewriteRule ^(.*) - [E=BASE:%1]
  
RewriteBase /skeleton

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [QSA,L]
</IfModule>

@eugene-borovov
Copy link

Hello @yutakatsuchida,

I have no ApacheServer about my hand. But I think this article should help you. The article describes your problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants