The URL rewrite module is disabled - Apache2 message while installing CS-CART 4.18.1

Hello guys,

we just bought new version of shop cs-cart 4.18.1 and our guy from cs-cart company is going to install it but he asked me to fix url redirect.

So apache2 have enabled module_redirect also in config file I have lines to enable rewrite and AllowOverride On. Same in .htaccess which is use from default one from installation files. I re-checked module and it is enabled. I read many forum posts about it and all should be fine. Maybe you have some idea hw to fix it?
This is code of config file for http and https

HTTP:

<Directory /var/www/html>
        RewriteEngine On
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        allow from all

        # SEO-friendly URL settings for CS-Cart
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ index.php?sef_rewrite=1&$1 [L,QSA]

        # Handle API requests
        RewriteRule ^api/(.*)$ api.php?_d=$1 [L,QSA]
    </Directory>

HTTPS:

 <Directory /var/www/html>
                        RewriteEngine On
                        AllowOverride All
                        allow from all
                </Directory>
                <Directory /var/www/html/install>
                        RewriteEngine On
                        AllowOverride All
                        allow from all
                </Directory>

also .htaccess:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase <root-location-of-cscart-files>
# Please note that RewriteBase setting is obsolete use it only in case you experience  some problems with># Some hostings require RewriteBase to be uncommented
# Example:
# Your store url is http://www.yourcompany.com/store/cart
# So "RewriteBase" should be:
# RewriteBase /store/cart
# RewriteBase /

# This setting is commented out because it might cause an error on some servers where MultiViews override># Enabling MultiViews can lead to unexpected results if an URI (for example, an URI of a SEO name)
# matches the structure of folders in the root directory of the store.
# If you have such URIs, please uncomment the following lines
# <IfModule mod_negotiation.c>
#    Options -MultiViews
# </IfModule>

   RewriteRule ^init.php$ - [F,L,NC]

   RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(favicon|apple-touch-icon|homescreen-|firefox-icon-|coast-icon-|mstile-).*\.(png|ico)$ - [>

  RewriteCond %{REQUEST_URI} ^api/(.*)$ [or]
  RewriteCond %{REQUEST_URI} .*/api/(.*)$
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule .*api/(.*)$ api.php?_d=$1 [L,QSA]

  RewriteCond %{REQUEST_URI} \.(png|gif|ico|swf|jpe?g|webp|js|css|ttf|svg|eot|woff|yml|xml)$ [NC,or]
  RewriteCond %{REQUEST_URI} store_closed.html$
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*?)\/(.*)$ $2 [L]

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . index.php [L,QSA]

</IfModule>

Also I saw 2 more .htaccess files in app/ and install/ folders. Also I added there rewrite engine on

A little bit too late with approving this post. I already fix it. It was in apache2 config file, I missed 1 line and also remove RewriteBase from .htaccess. So post can be close

3 Likes