- Enable Gzip (mod_deflate )
- Redirection (mod rewrite)
- Browser caching (mod header)
- Keep alive
enable gzip compression htaccess wordpress
<IfModule mod_deflate.c>
# Compress HTML, CSS, JavaScript, Text, XML and fonts
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE font/opentype
AddOutputFilterByType DEFLATE font/otf
AddOutputFilterByType DEFLATE font/ttf
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml
</IfModule>
enable leverage browser cache by editing .Htaccess
how to enable keep alive using htaccess in wordpress website?
just add this code to your .htaccess
<ifModule mod_headers.c>
Header set Connection keep-alive
</ifModule>
what is keep alive?
it’s communication between browser and server.
Why we want use keep alive?
To reduce server load by keep living the loaded resources in browser.
WordPress permalink redirection using htaccess
RewriteEngine on
RewriteBase /
RedirectMatch 301 /([0-9]+).html(.*) /?p=$1
RewriteEngine on
RewriteBase /
This would redirect the following URL:
?
1
http://www.mydomain.com/parts/spanner-1996.html
To:
?
1
http://www.mydomain.com/metal/parts/spanner-1996.html
subdomain to main domain redirection 301
RewriteCond %{HTTP_HOST} ^subdomain.fff.com
RewriteRule (.*) http://www.maindomain.com/$1 [R=301,L]
.htaccess rewrite rules
www to Non www redirection 301
RewriteCond %{HTTP_HOST} ^yourwebsite.com
RewriteRule (.*) http://www.yourwebsite.com/$1 [R=301,L]
Ask a Question:
You must be logged in to post a comment.