• Home
  • WordPress
  • web Hosting
    • Free hosting
    • Cheap Hosting
    • comparison cloud , vps, shared, wordpress
    • managed wordpress hosting
    • managed cloud hosting
  • page Speed
  • Deals
  • Services
  • About

RAaz Kumar .com

wordpress tutorials seo hosting etc


htaccess tutorial tips for wordpress #redirect #leverage browser cache #Gzip #KeepAlive

  All .htaccess tutorial tips for WordPress and other platforms. rewrite, redirect 301, 302, permalink rewriting, keep alive, gzip leverage browser cache 301 redirection using .htaccess and other etc.
htaccess only for apache server. for nginx, you have to convert this rules in nginx terms. (it quite easy)
  1. Enable Gzip  (mod_deflate )
  2. Redirection (mod rewrite)
  3. Browser caching (mod header)
  4. Keep alive
these rules  applies for whole server, however you can add it wordpress directory if your hosting provider not enabled by default. (note that module must be installed by server admin or hosting providers)

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

simply copy this code paste your in .htaccess by using cpanel or filezilla directly from your wordpress dashboard using yoast plugin
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg “access 1 year”
ExpiresByType image/jpeg “access 1 year”
ExpiresByType image/gif “access 1 year”
ExpiresByType image/png “access 1 year”
ExpiresByType text/css “access 1 month”
ExpiresByType application/pdf “access 1 month”
ExpiresByType text/x–javascript “access 1 month”
ExpiresByType application/x–shockwave–flash “access 1 month”
ExpiresByType image/x–icon “access 1 year”
ExpiresDefault “access 2 days”
## EXPIRES CACHING ##

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

permalink post_id.html to post name
http://www.airtel.in/24784.html  to http://www.airtel.in/tumkur-grain-merchants-cooperative-bank-limited-sdn-branch-ifsc-code-tgmb0000005-with-address-phone-number/
via: http://www.airtel.in/?p=24784
first of all, we have to redirect http://www.airtel.in/24784.html to http://www.airtel.in/?p=24784
RedirectMatch 301 /29954.html(.*) /?p=29954$1
RedirectMatch 301 /[0-9].html(.*) /?p=[0-9]$1
RedirectMatch 301 /([0-9]+).html(.*) /?p=([0-9]+)$1
RedirectMatch 301 /([0-9]+).html(.*) /?p=$1 (worked)
Options +FollowSymlinks
RewriteEngine on
RewriteBase /
RedirectMatch 301 /([0-9]+).html(.*) /?p=$1
then 2nd url will automatically redirects to present URL.
Matching cases
RewriteRule ^([0-9]+)$ /$1
Options +FollowSymlinks
RewriteEngine on
RewriteBase /
RewriteRule ^([0-9]+)$.html /?p=([0-9]+)$1

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

you can on off
.htaccess rewrite rules by using rewrite engine on or off

www to Non www redirection 301

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

Non www to www redirection 301

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


Redirecting to error page.

errorDocument 400 http://www.youwebsite.com/error.html
errorDocument 401 http://www.youwebsite.com/error.html
errorDocument 404 http://www.youwebsite.com/error.html
errorDocument 500 http://www.youwebsite.com/error.html

robots.txt tutorial.

Related topics:

  1. apache server tutorial (install,config, performance tuning, security, error handling)
  2. how to enable KeepAlive connections in apache nginx wordpress
  3. 301 & 302 Redirection in nginx, Htacess, wordpress etc Redirect URL & Domain SEO Friendly
  4. MySQL Tutorial (create,connect database, update tables, export etc) Documentation & TIPS
  5. website cache best caching plugins wordpress w3tc cloudflare

tutorials

  • MySQL Tutorial (create,connect database, update tables, export etc) Documentation & TIPS
  • apache server tutorial (install,config, performance tuning, security, error handling)
    • what is If-Modified-Since HTTP header how to add to Wordpress website
    • htaccess tutorial tips for wordpress #redirect #leverage browser cache #Gzip #KeepAlive
    • apache modules list (explained, enable disable)
    • connect to server by SSH client Putty SFTP client winscp LAMP, LEMP nginx apache etc linux
    • Lamp stack install on Ubuntu 20.4 LTS apache, mysql, php 7.4(Debian 9 & Ubuntu 18.04 lts)
    • apache performance tuning mpm-worker vs prefork vs event modules
    • enable caching in apache server (mod cache disk cache) vs fastcgi cache
    • how to enable KeepAlive connections in apache nginx wordpress
    • Cache control Header & expires headers How to set Properly
    • apache2 conf sample explained apache configuration file modules etc
    • restart apache in ubuntu (start | stop | reload | config test) centos debian mac linux windows 10 xampp
    • uninstall apache2 ubuntu in 3 steps Debian
  • Linux sysadmin tutorials linux system administrator
  • Core Java Tutorial Free online
  • HTML & CSS Tutorials
  • Php tutorials
  • ubuntu tutorials installation download issues etc
  • redis install ubuntu 20.04 with wordpress php redis mysql configuration
  • [INTRO] Ethical hacking / cyber Security / Penetration testing Tutorial -{updates frequently}
  • Android Studio tutorials syllabus Topics Course details #AndroidApplicationDevelopment
  • AUdio Editing Background Noise removal (Audacity, Adobe Premiere Addition, Camtasia Filmora Windows Obs)
  • Vivek Bindra Videos Transcription (business strategy)
  • nginx server tutorials (installation, configuration, performance tuning, security)
  • what is vpn vs proxy vs tor, http vs https, http2, tcp vs udp, kali linux sql source code injection
  • how to create a website free of cost on google
  • CCNA Syllabus pdf (CCNA / CCNP vs devops vs mcsa /MCSE)
  • Devops course Syllabus topics PDF AWS, Azure, cisco, redhat
  • Redis performance metrics & tuning for nginx apache ubuntu & debian
  • xampp tutorials 2021 installation errors fix wordpress phpmyadmin mysql apache
  • new relic installation linux (infrastructure agent , php, mysql , nginx)
  • new relic mysql install integration - 2 ways fix problems
  • new relic php agent install in 3 steps
  • git commands

 

 

wordpress Pagespeed optimization

Digitalocean free $100 Credit

Cloudways Review pricing promo codes

Siteground cpu limits Pricing

Shared Hosting

Managed wordpress Hosting

Managed Hosting Cloud server

VPS Hosting

Cloud Hosting – Unmanaged

Google cloud Pricing

Aws Pricing

Azure pricing

nginx server tutorials

apache server tutorials

linux sysadmin tutorials

mysql Commands list pdf

LEMP Install Ubuntu

Mysql Performance Tuning

Nginx Performance tuning

Linux Performance tuning

Php -fpm performance tuning

Redis Performance tuning

linux server security

nginx security best practices

wordpress security plugins

 

 

wordpress

 

Top 5  WP Google Analytics Plugins

WP Backup Plugins

Wp Comment Plugins

Top wordpress Security Plugins

WP Seo Plugins

WP Caching Plugins

Best Adsense Plugins for WordPress

Wp social Sharing Plugins

autoshare social media plugins

WP speed Optimization Plugins

Speedup WordPress google Score

More Wp tuts

Server Admin Cloud

 

Installing Nginx LEMP On ubuntu

Installing apache Lamp ubuntu

nginx fastcgi cache enable

php – fpm install  & Configuration

Opcache install & Configure

php -fpm pool manager explained

Mysql Install & Configuration

Redis Object cache install & configure

 

Nginx as Reverse Proxy and Load balancer

Load Balance / auto scaling in google cloud

Linux Commands PDF

Mysql Commands Pdf

Letsencrypt tutorial

mysqldump export & import 

Pagespeed Module install & configure

nginx.conf best file

mysql.conf best file

upgrade ubuntu

© 2023 - All Rights Reserved Disclaimer & Privacy Policy