wmaraci reklam

htaccess ile site hızlandırma kodları

6 Mesajlar 1.522 Okunma
wmaraci reklam

btnaslan btnaslan Bilinen Hayatı Kodlayın Kullanıcı
  • Üyelik 08.03.2017
  • Yaş/Cinsiyet 23 / E
  • Meslek WebMater, Seo, YouTuber
  • Konum İstanbul Avrupa
  • Ad Soyad B** A**
  • Mesajlar 1205
  • Beğeniler 131 / 220
  • Ticaret 16, (%100)
Merhaba arkadaşlar yaklaşık 1 haftadır siteme az oranda içerik giriyorum sebebi ise kafayı siteyi hızlandırma ile bozmamdan kaynaklı araştıra araştıra sonunda siteyi hızlandırdım.

Yanlız bu kod ile siteniz hızlanmaz bunun yanında WP Fastest Cache veya Litespeed kullanın. Daha sonra veritabanı temizliği yapın.

Wordpress kullanıcıları için htaccess kodunu aşağı bırakıyorum. Umarım işinize yarar :):angel:

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]



Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain.net [NC]
RewriteRule ^(.*)$ http://www.domain.net/ $1 [L,R=301]

#Expire Header

ExpiresActive On
ExpiresDefault A2592000


## EXPIRES CACHING ##

ExpiresActive On
ExpiresByType text/css A31536000
ExpiresByType application/x-javascript A31536000
ExpiresByType text/x-component A31536000
ExpiresByType text/html A3600
ExpiresByType text/richtext A3600
ExpiresByType image/svg+xml A3600
ExpiresByType text/plain A3600
ExpiresByType text/xsd A3600
ExpiresByType text/xsl A3600
ExpiresByType text/xml A3600
ExpiresByType video/asf A31536000
ExpiresByType video/avi A31536000
ExpiresByType image/bmp A31536000
ExpiresByType application/java A31536000
ExpiresByType video/divx A31536000
ExpiresByType application/msword A31536000
ExpiresByType application/vnd.ms-fontobject A31536000
ExpiresByType application/x-msdownload A31536000
ExpiresByType image/gif A31536000
ExpiresByType application/x-gzip A31536000
ExpiresByType image/x-icon A31536000
ExpiresByType image/jpeg A31536000
ExpiresByType application/vnd.ms-access A31536000
ExpiresByType audio/midi A31536000
ExpiresByType video/quicktime A31536000
ExpiresByType audio/mpeg A31536000
ExpiresByType video/mp4 A31536000
ExpiresByType video/mpeg A31536000
ExpiresByType application/vnd.ms-project A31536000
ExpiresByType application/x-font-otf A31536000
ExpiresByType application/vnd.oasis.opendocument.database A31536000
ExpiresByType application/vnd.oasis.opendocument.chart A31536000
ExpiresByType application/vnd.oasis.opendocument.formula A31536000
ExpiresByType application/vnd.oasis.opendocument.graphics A31536000
ExpiresByType application/vnd.oasis.opendocument.presentation A31536000
ExpiresByType application/vnd.oasis.opendocument.spreadsheet A31536000
ExpiresByType application/vnd.oasis.opendocument.text A31536000
ExpiresByType audio/ogg A31536000
ExpiresByType application/pdf A31536000
ExpiresByType image/png A31536000
ExpiresByType application/vnd.ms-powerpoint A31536000
ExpiresByType audio/x-realaudio A31536000
ExpiresByType image/svg+xml A31536000
ExpiresByType application/x-shockwave-flash A31536000
ExpiresByType application/x-tar A31536000
ExpiresByType image/tiff A31536000
ExpiresByType application/x-font-ttf A31536000
ExpiresByType audio/wav A31536000
ExpiresByType audio/wma A31536000
ExpiresByType application/vnd.ms-write A31536000
ExpiresByType application/vnd.ms-excel A31536000
ExpiresByType application/zip A31536000

## EXPIRES CACHING ##

# Compress JS and CSS

AddEncoding gzip .js
ForceType text/javascript


AddEncoding gzip .css
ForceType text/css



SetOutputFilter DEFLATE




RewriteEngine On
RewriteBase /
RewriteRule \.(gif|jpg|js|css)$ - [F]
RewriteRule \.(css)$ - [F]
RewriteRule ^(.*)\.css $1.css.gz [QSA]
RewriteRule ^(.*)\.js $1.js.gz [QSA]


#ETag#

Header set Expires "Thu, 15 Apr 2020 20:00:00 GMT"
Header unset ETag
FileETag None


#Kötü Bot engelleme #
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} Wget [OR]
RewriteCond %{HTTP_USER_AGENT} CherryPickerSE [OR]
RewriteCond %{HTTP_USER_AGENT} CherryPickerElite [OR]
RewriteCond %{HTTP_USER_AGENT} EmailCollector [OR]
RewriteCond %{HTTP_USER_AGENT} EmailSiphon [OR]
RewriteCond %{HTTP_USER_AGENT} EmailWolf [OR]
RewriteCond %{HTTP_USER_AGENT} ExtractorPro
RewriteRule ^.* - [F,L]
RewriteCond %{HTTP_USER_AGENT} ^BlackWidow [OR]
RewriteCond %{HTTP_USER_AGENT} ^Bot\ mailto:craftbot@yahoo.com [OR]
RewriteCond %{HTTP_USER_AGENT} ^ChinaClaw [OR]
RewriteCond %{HTTP_USER_AGENT} ^Custo [OR]
RewriteCond %{HTTP_USER_AGENT} ^DISCo [OR]
RewriteCond %{HTTP_USER_AGENT} ^Download\ Demon [OR]
RewriteCond %{HTTP_USER_AGENT} ^eCatch [OR]
RewriteCond %{HTTP_USER_AGENT} ^EirGrabber [OR]
RewriteCond %{HTTP_USER_AGENT} ^EmailSiphon [OR]
RewriteCond %{HTTP_USER_AGENT} ^EmailWolf [OR]
RewriteCond %{HTTP_USER_AGENT} ^Express\ WebPictures [OR]
RewriteCond %{HTTP_USER_AGENT} ^ExtractorPro [OR]
RewriteCond %{HTTP_USER_AGENT} ^EyeNetIE [OR]
RewriteCond %{HTTP_USER_AGENT} ^FlashGet [OR]
RewriteCond %{HTTP_USER_AGENT} ^GetRight [OR]
RewriteCond %{HTTP_USER_AGENT} ^GetWeb! [OR]
RewriteCond %{HTTP_USER_AGENT} ^Go!Zilla [OR]
RewriteCond %{HTTP_USER_AGENT} ^Go-Ahead-Got-It [OR]
RewriteCond %{HTTP_USER_AGENT} ^GrabNet [OR]
RewriteCond %{HTTP_USER_AGENT} ^Grafula [OR]
RewriteCond %{HTTP_USER_AGENT} ^HMView [OR]
RewriteCond %{HTTP_USER_AGENT} HTTrack [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Image\ Stripper [OR]
RewriteCond %{HTTP_USER_AGENT} ^Image\ Sucker [OR]
RewriteCond %{HTTP_USER_AGENT} Indy\ Library [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^InterGET [OR]
RewriteCond %{HTTP_USER_AGENT} ^Internet\ Ninja [OR]
RewriteCond %{HTTP_USER_AGENT} ^JetCar [OR]
RewriteCond %{HTTP_USER_AGENT} ^JOC\ Web\ Spider [OR]
RewriteCond %{HTTP_USER_AGENT} ^larbin [OR]
RewriteCond %{HTTP_USER_AGENT} ^LeechFTP [OR]
RewriteCond %{HTTP_USER_AGENT} ^Mass\ Downloader [OR]
RewriteCond %{HTTP_USER_AGENT} ^MIDown\ tool [OR]
RewriteCond %{HTTP_USER_AGENT} ^Mister\ PiX [OR]
RewriteCond %{HTTP_USER_AGENT} ^Navroad [OR]
RewriteCond %{HTTP_USER_AGENT} ^NearSite [OR]
RewriteCond %{HTTP_USER_AGENT} ^NetAnts [OR]
RewriteCond %{HTTP_USER_AGENT} ^NetSpider [OR]
RewriteCond %{HTTP_USER_AGENT} ^Net\ Vampire [OR]
RewriteCond %{HTTP_USER_AGENT} ^NetZIP [OR]
RewriteCond %{HTTP_USER_AGENT} ^Octopus [OR]
RewriteCond %{HTTP_USER_AGENT} ^Offline\ Explorer [OR]
RewriteCond %{HTTP_USER_AGENT} ^Offline\ Navigator [OR]
RewriteCond %{HTTP_USER_AGENT} ^PageGrabber [OR]
RewriteCond %{HTTP_USER_AGENT} ^Papa\ Foto [OR]
RewriteCond %{HTTP_USER_AGENT} ^pavuk [OR]
RewriteCond %{HTTP_USER_AGENT} ^pcBrowser [OR]
RewriteCond %{HTTP_USER_AGENT} ^RealDownload [OR]
RewriteCond %{HTTP_USER_AGENT} ^ReGet [OR]
RewriteCond %{HTTP_USER_AGENT} ^SiteSnagger [OR]
RewriteCond %{HTTP_USER_AGENT} ^SmartDownload [OR]
RewriteCond %{HTTP_USER_AGENT} ^SuperBot [OR]
RewriteCond %{HTTP_USER_AGENT} ^SuperHTTP [OR]
RewriteCond %{HTTP_USER_AGENT} ^Surfbot [OR]
RewriteCond %{HTTP_USER_AGENT} ^tAkeOut [OR]
RewriteCond %{HTTP_USER_AGENT} ^Teleport\ Pro [OR]
RewriteCond %{HTTP_USER_AGENT} ^VoidEYE [OR]
RewriteCond %{HTTP_USER_AGENT} ^Web\ Image\ Collector [OR]
RewriteCond %{HTTP_USER_AGENT} ^Web\ Sucker [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebAuto [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebCopier [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebFetch [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebGo\ IS [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebLeacher [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebReaper [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebSauger [OR]
RewriteCond %{HTTP_USER_AGENT} ^Website\ eXtractor [OR]
RewriteCond %{HTTP_USER_AGENT} ^Website\ Quester [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebStripper [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebWhacker [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebZIP [OR]
RewriteCond %{HTTP_USER_AGENT} ^Wget [OR]
RewriteCond %{HTTP_USER_AGENT} ^Widow [OR]
RewriteCond %{HTTP_USER_AGENT} ^WWWOFFLE [OR]
RewriteCond %{HTTP_USER_AGENT} ^Xaldon\ WebSpider [OR]
RewriteCond %{HTTP_USER_AGENT} ^Zeus
RewriteRule ^.* - [F,L]
RewriteCond %{HTTP_REFERER} http//buy-cheap-online\.info [NC]
RewriteRule .* - [F]


# END WordPress
Cancaliskan38

kişi bu mesajı beğendi.

wmaraci
reklam

bilisimciblog bilisimciblog Üyeliği Durdurulmuş Banlı Kullanıcı
  • Üyelik 10.11.2018
  • Yaş/Cinsiyet 35 / E
  • Meslek Bilgi İşlem
  • Konum İstanbul Avrupa
  • Ad Soyad U** B**
  • Mesajlar 392
  • Beğeniler 141 / 79
  • Ticaret 0, (%0)
Bu gerçekten işe yarıyor mu? Başka yorumlarda bekleyelim 🙂
 

 

btnaslan btnaslan Bilinen Hayatı Kodlayın Kullanıcı
  • Üyelik 08.03.2017
  • Yaş/Cinsiyet 23 / E
  • Meslek WebMater, Seo, YouTuber
  • Konum İstanbul Avrupa
  • Ad Soyad B** A**
  • Mesajlar 1205
  • Beğeniler 131 / 220
  • Ticaret 16, (%100)

bilisimciblog adlı üyeden alıntı

Bu gerçekten işe yarıyor mu? Başka yorumlarda bekleyelim 🙂


Ben denedim işe yaradı
 

 

yilmaz70 yilmaz70 Güzel olacak Kullanıcı
  • Üyelik 03.02.2017
  • Yaş/Cinsiyet 53 / E
  • Meslek Web Tasarım
  • Konum İstanbul Anadolu
  • Ad Soyad D** K**
  • Mesajlar 4766
  • Beğeniler 3155 / 3156
  • Ticaret 12, (%100)
Her sunucuda aynı performansı yakalayamazsınız.

Litespeed cache eklentisi kullananlar htaccess dosyasına müdahale etmemelidir. Zaten eklenti kendi ekliyor kodları. Aynı durum diğer eklentiler için de geçerli.
 

 

wmaraci

yilmaz70 yilmaz70 Güzel olacak Kullanıcı
  • Üyelik 03.02.2017
  • Yaş/Cinsiyet 53 / E
  • Meslek Web Tasarım
  • Konum İstanbul Anadolu
  • Ad Soyad D** K**
  • Mesajlar 4766
  • Beğeniler 3155 / 3156
  • Ticaret 12, (%100)
Bir örnek de benden gelsin madem.

Options All -Indexes

# Disable ETags

Header unset ETag
Header set Connection keep-alive

FileETag None




Header set Access-Control-Allow-Origin "*"



########### REDIRECT TRAFFIC TO HTTPS ############
# RewriteEngine On
# RewriteCond %{HTTPS} off
# RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

############ SECURITY ###########

Order allow,deny
Deny from all



Allow from all


############## CACHING-GZIP ############

ExpiresActive On
ExpiresDefault A2592000


ExpiresDefault A2592000



ExpiresDefault A2592000



ExpiresDefault A2592000



ExpiresDefault A2592000





Header set Cache-Control "max-age=2592000"



Header set Cache-Control "max-age=2592000"



Header set Cache-Control "max-age=2592000"



Header set Cache-Control "max-age=2592000"






SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding



AddOutputFilterByType DEFLATE "application/atom+xml" \
"application/javascript" \
"application/json" \
"application/ld+json" \
"application/manifest+json" \
"application/rdf+xml" \
"application/rss+xml" \
"application/schema+json" \
"application/vnd.geo+json" \
"application/vnd.ms-fontobject" \
"application/x-font-ttf" \
"application/x-javascript" \
"application/x-web-app-manifest+json" \
"application/xhtml+xml" \
"application/xml" \
"font/eot" \
"font/opentype" \
"image/bmp" \
"image/svg+xml" \
"image/vnd.microsoft.icon" \
"image/x-icon" \
"text/cache-manifest" \
"text/css" \
"text/html" \
"text/javascript" \
"text/plain" \
"text/vcard" \
"text/vnd.rim.location.xloc" \
"text/vtt" \
"text/x-component" \
"text/x-cross-domain-policy" \
"text/xml"



AddEncoding gzip svgz





# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]


# END WordPress


Ama daha önce dediğim gibi, her sunucuda farklı netice verecektir. Değişiklik yapmadan önce mutlaka eski htacces dosyasının yedeğini alın.

İyi denemeler :)
 

 

batuhan745 batuhan745 WM Aracı Kullanıcı
  • Üyelik 30.11.2018
  • Yaş/Cinsiyet 27 / E
  • Meslek e ticaret
  • Konum Bursa
  • Ad Soyad B** T**
  • Mesajlar 158
  • Beğeniler 25 / 24
  • Ticaret 2, (%100)
şimdi konuyu gördükten sonra yedek alıp uyguladım. wp cache eklentisi çalışmadı. onun dışında herhangi bir problem gözükmedi
 

 

ya bugün adım at ya da ömür boyu emekle
wmaraci
Konuyu toplam 1 kişi okuyor. (0 kullanıcı ve 1 misafir)
Site Ayarları
  • Tema Seçeneği
  • Site Sesleri
  • Bildirimler
  • Özel Mesaj Al