Hi,
I installed TI to subdom folder - installation is OK, but then I got ERROR 500.

If I delete .htaccess, then I see “Getting Started” page, but nothing else works.

Links goes to: subdom.domain.tld/subdom/tifolder/admin/themes but there is 404.
If I set correct folder to admin/themes I am stil getting 404.

Folder structure:

/www
-domains
------domain.tld
-subdom
-----tifolder

.htaccess in www:

RewriteEngine On
# domains/aliases
RewriteCond %{REQUEST_URI} !^domains/
RewriteCond %{REQUEST_URI} !^/domains/
RewriteCond %{HTTP_HOST} ^(www\.)?(.*)$
RewriteCond %{DOCUMENT_ROOT}/domains/%2 -d
RewriteRule (.*) domains/%2/$1 [DPI]
# subdomains
RewriteCond %{REQUEST_URI} !^subdom/
RewriteCond %{REQUEST_URI} !^/subdom/
RewriteCond %{HTTP_HOST} ^(www\.)?(.*)\.([^\.]*)\.([^\.]*)$
RewriteCond %{DOCUMENT_ROOT}/subdom/%2 -d
RewriteRule (.*) subdom/%2/$1 [DPI]
# aliases redirect
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^domains/[^/]+/(.+[^/])$ /$1/ [R]
# subdomains redirect
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^subdom/[^/]+/(.+[^/])$ /$1/ [R]
# https
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

I am unable to find the problem in the “main” .htaccess and “ti” default .htaccess

URL uses HTTPS with LetsEncrypt certificate.

Thanks for any tips and help. 🙂

    dominik-stastny You’re missing RewriteBase on your .htaccess file

    RewriteBase /

    If you’ve created a subdirectory, you can add the subdirectory name as well:RewriteBase /mysubdirectory/

    There are some extra system requirements if your webserver is running Apache, mod_rewrite should be installed and enabled and the AllowOverride option should be switched on.

    source: https://tastyigniter.com/docs/master/installation#apache-configuration

      mlattke

      I enabled RewriteBase in the folder subdom/ti/.htaccess but still 500, if I add RewriteBase to “main” .htaccess and disable “ti” .htaccess - its working “Getting Started” but I am unable to get anywhere else and links are again with subdom/tifolder/admin/themes with 404.

      <IfModule mod_rewrite.c>
        <IfModule mod_negotiation.c>
          Options -MultiViews -Indexes
        </IfModule>
      
        ## You may need to uncomment the following line for some hosting environments,
        ## to use URL Alias you need to be running apache with mod_rewrite enabled.
        ##
        # Options +FollowSymlinks
      
        ## Turn on URL rewriting
        ##
        RewriteEngine On
      
        ## !IMPORTANT! You may need to uncomment the following line for some hosting environments,
        ## If your installation resides in a subdirectory, enter the name here also
        ##
        RewriteBase /
      
        ## Redirect index.php from url to prevent duplicate urls
        ##
        RewriteCond %{THE_REQUEST} /index\.php [NC]
        RewriteRule ^(.*?)index\.php[^/] /$1? [L,R=301,NC,NE]
      
        RewriteCond %{THE_REQUEST} /index\.php [NC]
        RewriteRule ^(.*?)index\.php(?:/(.*))?$ /$1$2? [L,R=301,NC,NE]
      
        ## Redirect Trailing Slashes If Not A Folder...
        ##
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_URI} (.+)/$
        RewriteRule ^ %1 [L,R=301]
      
        ## Block all PHP files, except index
        ##
        RewriteCond %{REQUEST_FILENAME} -f
        RewriteCond %{REQUEST_FILENAME} \.php$
        RewriteRule !^index.php index.php [L,NC]
      
        ## Blacklisted folders
        ##
        RewriteRule ^assets/downloads/(.*) not_found [L]
      
        # Handle Front Controller...
        ##
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^ index.php [L,QSA]
      </IfModule>

        Also RewriteBase / should be RewriteBase /yoursubfolder/

          breaksecurity
          Thanks - app.php and URL is now fixed. 🙂 I overlooked this file.

          Now “Getting Started” shows correct URL to admin dashboard:
          https://subdomname.domain.tld/admin/themes

          but content after clicking shows (should be lead to /admin/themes only, I guess):
          Not Found
          The requested URL /subdom/subdomname/admin/themes was not found on this server.

          Subdom is hostings company folder on the same level as domains folder.

            Your hosting company server will consider as / “root” your public_html folder.

            try to consider as / the folder where they put the default.php page. It depends anyway on your hosting company

              breaksecurity
              It looks problem was with

              <IfModule mod_rewrite.c>
                <IfModule mod_negotiation.c>
                  Options -MultiViews -Indexes
                </IfModule>

              and after removing these lines I am now able to see login page and dashboard - I will check how it works and write here the result… but it is strange. 🙂

                So it seems its working after all. 🙂

                Here is, what is changed:

                • edited config/app.php
                • removed all <> lines/sections
                • edited RewriteBase to subdom/subdomname

                Thank you for your help and to guide me the right direction to solve this problem. 🙂