What I want to achieve:
www.mydomain/app => www.mydomain/app/
Only for this url.
I'm using Slim Framework and this is how I handle my route:
$app->get('/', function () use ($app){
// Some code goes here
});
What I've tried:
1) Any results with these:
$app->get('/?', function () use ($app){
// Some code goes here
});
$app->get('(/)', function () use ($app){
// Some code goes here
});
2) This one works great but brokes my other routes:
RewriteCond $0 !^app(/|$)
RewriteRule ^[^\.]+[^/]$ /$0/ [R=301,L]
For example I got route
www.mydomain.com/app/panel
after rules above it redirects me to
www.mydomain.com/panel/
3) This one also works but it adds slashes for every url:
# Add a trailing slash to any non-existent files
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ %{REQUEST_URI}/ [R=301,L]
4) This one redirects me to www.mydomain.com/
RewriteCond %{REQUEST_URI} ^/(app|foo|bar)$
RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1/ [R=301,L]
Thank you for any guidance or references that might help me.
UPDATE:
My root directory .htaccess:
AddHandler php53 .php
Action php53 /cgi-bin/php53.cgi
DirectoryIndex index.php
<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>
RewriteEngine on
#RewriteCond %{REMOTE_HOST} !^192\..*
#RewriteRule ^(.*) http://www.randomurl.com/$1 [R,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?rqp=$1 [L,QSA]
php_flag last_modified 1
php_flag register_globals 0
php_flag display_errors 1
php_flag magic_quotes_gpc 1
php_flag error_reporting E_ALL
AddDefaultCharset utf-8
#AddType text/html .d
AddHandler application/x-httpd-php .dll
My app directory .htaccess:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]
If all you want is this
www.mydomain/app => www.mydomain/app/
Then you can just add this line in your DOCUMENT_ROOT/.htacces
:
DirectorySlash On
as the first line in your root .htaccess