Jump to content

URL Compression Test & url rewriting


Coal_Sa

Recommended Posts

Hello, i'm new to prestashop,

my shop is in a subdomain: shop.xxxx.ch

i have a html page to hide the site. anyway the site main url is shop.xxxx.ch/index.php

i'm sure compression gzip on a apache server is enabled.

i can see that with a phpinfo.php file, as well as asking my host.

if i try to test the compression with a tool as http://www.whatsmyip.org/http-compression-test/ or GTMetrix or pagespeedinsight, it tell me compression is not enabled.

if i test the html page, compression is ok.

if i test the php one it says Error - Unable To Load URL

i regenerated the htaccess but no way.

shop url is set as shop.xxxx.ch

ssl domain as shop.xxxx.ch

base url is /

 

url rewrite is on, my host support it,

accentuated url off

apache multiviews is on

mod_security is on

 

i try to understand what i am doin' wrong.

 

if i try to get http headers for my main url i get a 200,

if i try to get http headers for the shop base url as shop.xxxx.ch/fr i get a HTTP/1.1 301 Moved Permanently

 

to be more precise, a test on shop.xxxx.ch (my html page) show compression enabled,

a test on shop.xxxx.ch/index.php make me a Error - Unable To Load URL

 

if i look my .htaccess compression seems enabled

 

<IfModule mod_deflate.c>

<IfModule mod_filter.c>

AddOutputFilterByType DEFLATE text/html text/css text/javascript application/javascript application/x-javascript font/ttf application/x-font-ttf font/otf application/x-font-otf font/opentype

</IfModule>

</IfModule>

 

and my rewrite rules are:

 

<IfModule mod_rewrite.c>

<IfModule mod_env.c>

SetEnv HTTP_MOD_REWRITE On

</IfModule>

RewriteEngine on

 

#Domain: shop.xxxx.ch

RewriteRule . - [E=REWRITEBASE:/]

RewriteRule ^api$ api/ [L]

 

RewriteRule ^api/(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]

 

can someone point me in the right direction please ? will be much appreciated

Edited by Coal_Sa (see edit history)
Link to comment
Share on other sites

Ok, regarding PageSpeed Insight, pingdom, webpagetest and gtmetrix not detecting gzip compression, solved by adding

 

if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) ob_start("ob_gzhandler"); else ob_start();

 

in the beginning of 'index.php' file, the one in the main PrestaShop directory, just before the line:

 

require(dirname(__FILE__).'/config/config.inc.php');

 

now all services detect gzip compression

Edited by Coal_Sa (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...