Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP] Problem z kompresją strony, .htaccess
senior.pol
post
Post #1





Grupa: Zarejestrowani
Postów: 158
Pomógł: 0
Dołączył: 10.08.2011

Ostrzeżenie: (0%)
-----


Witam,

W pliku .htaccess mam następujący kod:

Kod
<IfModule mod_gzip.c>
    mod_gzip_on       Yes
    mod_gzip_dechunk  Yes
    mod_gzip_item_include file      \.(html?|txt|css|js|php|pl)$
    mod_gzip_item_include handler   ^cgi-script$
    mod_gzip_item_include mime      ^text/.*
    mod_gzip_item_include mime      ^application/x-javascript.*
    mod_gzip_item_exclude mime      ^image/.*
    mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</IfModule>

RewriteEngine On

RewriteCond %{HTTP_HOST} ^sternicy.com.pl$
RewriteRule ^(.*)$ http://www.sternicy.com.pl/$1 [R=301,L]


RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php


Niestety po wykonaniu testu PageSpeed Insights dalej mam komunikat, aby włączyć kompresję. Czy to błąd w skrypcie, czy coś należy jeszcze dodać/poprawić?

Ktoś pomoże? (IMG:style_emoticons/default/co_jest.gif)

Ten post edytował senior.pol 26.03.2014, 19:22:50
Go to the top of the page
+Quote Post
IProSoft
post
Post #2





Grupa: Zarejestrowani
Postów: 479
Pomógł: 97
Dołączył: 6.09.2011
Skąd: php.net :)

Ostrzeżenie: (0%)
-----


A próbowałeś z AddOutputFilterByType ?
Go to the top of the page
+Quote Post
trueblue
post
Post #3





Grupa: Zarejestrowani
Postów: 6 806
Pomógł: 1828
Dołączył: 11.03.2014

Ostrzeżenie: (0%)
-----


Na jakim hostingu testujesz?
Go to the top of the page
+Quote Post
senior.pol
post
Post #4





Grupa: Zarejestrowani
Postów: 158
Pomógł: 0
Dołączył: 10.08.2011

Ostrzeżenie: (0%)
-----


Cytat(IProSoft @ 26.03.2014, 19:29:02 ) *
A próbowałeś z AddOutputFilterByType ?


Próbowałem teraz, niestety efektem jest błąd 500 (IMG:style_emoticons/default/co_jest.gif)

Kod
<IfModule mod_deflate.c>
    mAddOutputFilterByType DEFLATE text/plain
    AddOutputFilterByType DEFLATE text/html
    AddOutputFilterByType DEFLATE text/xml
    AddOutputFilterByType DEFLATE text/css
    AddOutputFilterByType DEFLATE application/xml
    AddOutputFilterByType DEFLATE application/xhtml+xml
    AddOutputFilterByType DEFLATE application/rss+xml
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE application/x-javascript
</ifModule>


Cytat(trueblue @ 26.03.2014, 19:34:07 ) *
Na jakim hostingu testujesz?


linuxpl

Ten post edytował senior.pol 26.03.2014, 19:41:39
Go to the top of the page
+Quote Post
IProSoft
post
Post #5





Grupa: Zarejestrowani
Postów: 479
Pomógł: 97
Dołączył: 6.09.2011
Skąd: php.net :)

Ostrzeżenie: (0%)
-----


Zerknij tutaj: http://gtmetrix.com/enable-gzip-compression.html

W Twoim kodzie jest literówka w 2 lini, stąd błąd 500
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 23.08.2025 - 19:31