Url Rewrite Engine Is Disabled Message

Hello,

During CS-Cart installation, when accessing site by URL, there is a message saying URL rewrite engine is disabled. However, when accessing site by IP URL rewrite seems working. Plea se help me figure out why it happens. Screen shoots are attached.

Thank you for your help.

cscart_error1.png

cscart_error2.png

Hello,

During CS-Cart installation, when accessing site by URL, there is a message saying URL rewrite engine is disabled. However, when accessing site by IP URL rewrite seems working. Plea se help me figure out why it happens. Screen shoots are attached.

Thank you for your help.

This message indicates that the URL rewrite engine is not installed or disabled on your server. This affects the SEO add-on functionality. Please contact your server administrator and make sure that the mod_rewrite Apache module is installed on the server. Also, please make sure that directives from the .htaccess file are supported.

Please refer to the following page to learn more about CS-Cart system requirements:

http://docs.cs-cart.com/4.3.x/install/system_requirements.html

Sorry, does not make sense to me. If I access server http://IP_address/ and try to install CS-Cart, there is no message URL rewrite engine is disabled. When I access server http://mydomain.com/ and try to install CS-Cart, there is that message URL rewrite engine is disabled. PHP info shows mod_rewrite is enabled on the server. .htaccess file is the one that comes with CS-Cart. I did not make any changes to it.

app/Tygh/Validators.php

Looks like the isModRewriteEnabled returns false in your case. Please debug the headers variable:

fn_print_r($headers);

Hi, I know this is an old post, but I am facing the same challenge. Can you be a bit more specific about how to debug the error? Where do we add that code?

Does your server use nginx or apache?

Hello, thanks for replying.
My server uses Apache

Please make sure that the .htaccess file exists in the core of your CS-Cart installation

If not, copy it from clean distributive

This installation is clean and the .htaccess exists. In fact, the code below is found in file.
Line 39 - 47

<IfModule mod_rewrite.c>
RewriteEngine on
# Please note that RewriteBase setting is obsolete use it only in case you experience  some problems with SEO addon.
# 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 /

I have two .htaccess files, one is in the root of the domain and the other one is in the app/.htaccess
The one in the app has the following code

<IfModule mod_authz_core.c>
    Require all denied
</IfModule>

<IfModule !mod_authz_core.c>
    Order Allow,Deny
    Deny from all
</IfModule>

This is the full code found in the .htaccess file

DirectoryIndex index.html index.php

<IfModule mod_deflate.c>
	# Compress HTML, CSS, JavaScript, Text, XML, fonts
	AddOutputFilterByType DEFLATE application/javascript application/x-javascript text/javascript application/json
	AddOutputFilterByType DEFLATE application/x-font application/x-font-opentype application/x-font-otf application/x-font-truetype application/x-font-ttf font/opentype font/otf font/ttf application/x-woff application/x-font-woff
	AddOutputFilterByType DEFLATE text/css text/html text/plain

	<IfModule mod_headers.c>
		# Remove browser bugs (only needed for really old browsers)
		BrowserMatch ^Mozilla/4 gzip-only-text/html
		BrowserMatch ^Mozilla/4\.0[678] no-gzip
		BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
		Header append Vary User-Agent
	</IfModule>
</IfModule>

<IfModule mod_headers.c>
	<FilesMatch "\.(ttf|ttc|otf|eot|woff|css|png|gif|ico|jpe?g)$">
		Header set Access-Control-Allow-Origin "*"
	</FilesMatch>
</IfModule>

# Cache all images for 2 weeks
<IfModule mod_expires.c>
	<FilesMatch "\.(jpg|jpeg|png|gif|tiff|bmp|js|css)$">
	    ExpiresActive on
	    ExpiresDefault "access plus 2 weeks"
	</FilesMatch>
</IfModule>

<IfModule mod_headers.c>
	<filesMatch "\.(gif|png|jpg|jpeg|ico|js|css)$">
		Header set Cache-Control "max-age=1209600"
	</filesMatch>
</IfModule>


<IfModule mod_rewrite.c>
RewriteEngine on
# Please note that RewriteBase setting is obsolete use it only in case you experience  some problems with SEO addon.
# 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 is forbidden.
# 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)$ - [R=404,NC,L]

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|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>

# This prevents possible problems when downloading files
<IfModule mod_php5.c>
    php_flag zlib.output_compression Off
</IfModule>

Do you install new store to domain subdirectory?

No. The shop is installed on the main domain.

Hello!

Could you please check that the mod_rewrite Apache module is installed and enabled at your server?

Hi, yes my host double checked and confirmed that mod_rewrite is, indeed installed and enabled.
By the way, the strange thing about that warning message is that, at first I was not able to proceed with the installation. But later I was eble to install. Also, even though the warning said SEO woulld’t work, my SEO addon is active and seems to be working just fine. Not sure if what the message meant was that SEO wont be captured by search engines or what really.

If the SEO add-on is enabled and working as intended, then most probably there should nothing to worry about.

You can also try to disable the SEO add-on and enable it back again. If everything is okay and add-on is being enabled without issues - then everything is okay at the moment and seems to be, the server configuration was updated since that time when you were facing the issue. Otherwise, if you will be unable to set the SEO add-on to active status back, please contact us via Help Desk on this case, we will try to help you.

I did as advised. I disabled the SEO add-on and reenabled it again and it worked fine, with no issues.

1 Like

So seems to be currently, there are no issues here, everything should work as expected :slight_smile:

Yes! Quick question.
Since Google is phasing out Universal Analytics in favour of GA4. What happens to the default Cs-Cart Google analytics add-on? Can we use the new GA4 Measurement ID, right now?

The Google Analytics add on is compatible with either. You just need to get the GA4 id and replace the UA id in the settings of the add on.

2 Likes