Apache .htaccess for AppMail

Apache .htaccess for AppMail

Assuming AppMail is installed in your document root, in an absolute path like:

/home/yourdomain/public_html

and accessible at

https://www.yourdomain.com/

then in

/home/yourdomain.com/public_html/.htaccess

you will put:

# BEGIN rewrite rules
<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteBase /

    # BACKEND APP
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
    RewriteCond %{REQUEST_URI} ^/backend(/.*)?$
    RewriteRule backend/.* backend/index.php

    # CUSTOMER APP
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
    RewriteCond %{REQUEST_URI} ^/customer(/.*)?$
    RewriteRule customer/.* customer/index.php

    # API APP
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
    RewriteCond %{REQUEST_URI} ^/api(/.*)?$
    RewriteRule api/.* api/index.php


    # FRONTEND APP
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
    RewriteRule . index.php
</IfModule>
# END rewrite rules

Please note that the above rules can also be generated from backend of your application by going to Backend > Settings > Common.

    • Related Articles

    • Nginx server basic configuration for AppMail

      Please note that the below configuration is going to use php-fpm for what is worth. /etc/nginx/nginx.conf # For more information on configuration, see: # * Official English Documentation: https://nginx.org/en/docs/ # * Official Russian Documentation: ...
    • Extend AppMail

      AppMail is highly extensible and flexible. You can extend it using a high number of extensions for payments, backup, email validation and so on, you can alter the look of it by either using customisations or custom themes and you can translate it in ...
    • Use 2FA in AppMail

      Two-factor authentication (2FA), sometimes referred to as two-step verification or dual-factor authentication, is a security process in which users provide two different authentication factors to verify themselves. This process is done to better ...
    • AppMail and GDPR

      GDPR has been in effect starting 25th of May 2018. We don’t provide legal advice; you should consult your legal advisor regarding the way you conduct your business and what you should do to comply with GDPR. GDPR has a few main principles, below we ...
    • Upgrading notes for AppMail 1.x to AppMail 2.x

      When upgrading from AppMail 1.x to AppMail 2.x there are a few things you need to do before starting the upgrade process. #1. It is very important you backup your application, be it on your own or by using the Backup Manager. #2. You need to disable ...