Problem with Subdomain and htaccess

Discussion in 'ISPConfig 3 Priority Support' started by Gaston Girardi, Sep 15, 2020.

  1. Gaston Girardi

    Gaston Girardi Member HowtoForge Supporter

    Hi, i'm having a strange problem with all the subdomains, for some reason the redirect from htaccess doesn't work unless you tipe index.php in the link, but that will only work for the first.

    As an example i have a subdomain abc.domain.ltd when i try to access the web i get a 404 error (This web redirect me to a link like this https://abc.domain.ltd/Admin_dashboard/login), and as i told you if i add the index.php i see the login page (https://abc.domain.ltd/index.php/Admin_dashboard/login), the problem is if i try to login these didn't work because it redirectme again to a page without the index.php

    the htaccess file is this:
    Code:
    RewriteEngine on
    RewriteCond $1 !^(index\.php|resources|robots\.txt)
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L,QSA]
    
    My question is if i need to set something different on ISPconfig?, or need to change something in the server?, because this is the same to all the subdomains with htaccess.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    You added the subdomains in ispconfig as subdomains, not vhost subdomains, and you did not set any kind of redirect in ISPConfig, right? If that#s the case, then you must search in the application that you installed inside the website.
     
  3. Gaston Girardi

    Gaston Girardi Member HowtoForge Supporter

    What i did is added in Sites -> Websites -> Subdomain for website

    Host: abc
    Domain: i selected the one i need
    Redirect Type: L
    Redirect Path: /home/www/clients/clientx/webxx/web/subdominios/abc/

    And create an A record in the DNS zone for the subdomain

    About "search in the application that you installed inside the website.", that part is no clear, search for what?
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Undo the redirect settings you made.
     
  5. Gaston Girardi

    Gaston Girardi Member HowtoForge Supporter

    If i do that the only thing i see is the main website, the one for the domain.
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok, so you don't use a cms that's multidomain capable then? In that case, delete the subdomain and create a vhost subdomain instead, use /web/subdominios/abc/ as path for the vhost subdomain.
     
  7. Gaston Girardi

    Gaston Girardi Member HowtoForge Supporter

    I don't get it, i have more than 20 subdomains (some domains has even 2 subdomains), the ones that don't have an htaccess file works perfectly with the setting i post before, why the ones that use an htaccess file need a cms like Joomla, Drupal or Typo3? (As a comment I didn't know what CMS mean i had to look for it in the Forum).

    And the second one is how do i create a vhost subdomain? :oops:, is there a setting in the panel?
     
  8. Gaston Girardi

    Gaston Girardi Member HowtoForge Supporter

    Ok searching i found how to activate the vhost for subdomain and i added like you said, now i'm getting a message "No input file specified.", i don't know if this is an advance or not :confused: but i feel i'm closer.

    Again if i put manually in the link "index.php" the login page load perfectly (as i told at my first post these didn't work because it redirects me again to a page without the index.php).
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    And you have that .htaccess file in the folder /home/www/clients/clientx/webxx/web/subdominios/abc/ ?
     
  10. Gaston Girardi

    Gaston Girardi Member HowtoForge Supporter

    Yes i have the .htaccess and the index.php there and all the rest of the files are in different folders, but everything in the abc.
     
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    Then the wrong redirect might com from that software that you installed in the abc folder or you somehow manually disabled .htaccess for subfolders in that site.
     
  12. Gaston Girardi

    Gaston Girardi Member HowtoForge Supporter

    As far as i know i didn't disabled anything, but how do i check that?
     
  13. till

    till Super Moderator Staff Member ISPConfig Developer

    Check all .htaccess files in the folder tree and also the apache directives field of that website on the options tab of the web in ISPConfig.
     
  14. Gaston Girardi

    Gaston Girardi Member HowtoForge Supporter

    For that website the Apache Directive field under "options" is empty, but in the "Apache AllowOverride" it has the Value "All".
     
  15. Gaston Girardi

    Gaston Girardi Member HowtoForge Supporter

    Ok it works now, the only thing i had to do it was in the vhost subdomain change the PHP option to MOD-PHP, with that it works perfectly. Thanks a lot for the Help Till
     

Share This Page