Default .htaccess file for wordpress with compression and caching tweaks

Here is the default .htaccess file for wordpress

If you are using cpanel, before you proceed make sure that you don’t have htaccess file already. Default File Manager settings in cpanel make it hidden

Default Settings in cPanel File Manager

.htaccess file – default code for wordpress

# BEGIN WordPress
<ifmodule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</ifmodule>
# END WordPress

If your WordPress Installation is inside a directory say knowledge, which means your wordpress url is https://abcd.com/knowledge/ then htaccess code would be

# BEGIN WordPress
<ifmodule mod_rewrite.c>
RewriteEngine On
RewriteBase /knowledge/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /knowledge/index.php [L]
</ifmodule>
# END WordPress

Add the following code for Leverage Browser Caching

<ifmodule mod_expires.c>
ExpiresActive On
</ifmodule>

# Images
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/webp "access plus 1 year"
ExpiresByType image/svg+xml "access plus 1 year"
ExpiresByType image/x-icon "access plus 1 year"

# Video
ExpiresByType video/mp4 "access plus 1 year"
ExpiresByType video/mpeg "access plus 1 year"

# CSS, JavaScript
ExpiresByType text/css "access plus 1 month"
ExpiresByType text/javascript "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"

# Others
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"

Add the following code for GZip Compression

<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>

# Remove browser bugs (only needed for really old browsers)
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Header append Vary User-Agent

How to Disable Default "Quick Access" aka "Home View" in Windows 10 File Explorer? – AskVG

If you are using Windows 10 or have seen the OS in any computer, you might be aware of the new Home aka Quick Access View introduced in Windows 10 File Explorer (previously known as Windows Explorer or My Computer).

This new Quick Access or Home view is the default page of File Explorer in Windows 10 and whenever you open File Explorer using its shortcut icon or WIN+E hotkey, this new view is shown in File Explorer. It shows frequently used folders and recently used files list in File Explorer as shown in following screenshot:

Windows_10_File_Explorer_Quick_Access_Home_View.png

Although Microsoft designed this new view for users convenience but most of the Windows 10 users don’t like this default view. They find it annoying as they have to click on This PC link in left-side pane to access disk drives each time they open File Explorer. Also sometimes users don’t want to show frequently accessed folders or recently opened files in File Explorer due to privacy issues.

In older preview builds of Windows 10, Microsoft didn’t provide any way to disable/remove this new Quick Access or Home view in File Explorer and users had to use Registry tweaks to get rid of this view such as deleting items keys under HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionexplorerHomeFolderNameSpaceDelegateFolders key in Registry Editor using similar instructions given in following exclusive AskVG tutorial:

How to Remove Unwanted Items from My Computer in Windows?

But since the release of build 9926 of Windows 10, Microsoft has made users life easier by providing built-in options to customize Quick Access or Home view or completely disabling this new view in File Explorer.

If you are using Windows 10 and want to do any of following things:

  • Remove frequently used folders list from Quick Access/Home view in File Explorer
  • Remove recently used files list from Quick Access/Home view in File Explorer
  • Get rid of the new Quick Access/Home view in File Explorer

This tutorial will definitely help you. Just follow these simple steps to bring back the old This PC view in Windows 10 File Explorer:

1. Open File Explorer, click on View tab in Ribbon and then click on Options.

2. Now to remove frequent folders and recent files list from Quick Access/Home view, uncheck following 2 options present under Privacy section:

  • Show recently used files in Quick Access
  • Show frequently used folders in Quick Access

It’ll immediately remove these 2 sections from Quick Access view in File Explorer.

Change_Windows_10_File_Explorer_Quick_Access_Home_View.png

3. If you want to completely get rid of Quick Access/Home view from File Explorer, change the option “Open File Explorer to” from “Quick access” to “This PC” using drop-down list. It’ll set the old This PC view as default in File Explorer and you’ll always have disk drives page visible whenever you open File Explorer.

4. One more thing! If you also want to remove the unnecessary 6 folders “Desktop, Documents, Downloads, Music, Pictures and Videos” from This PC and extra icons such as OneDrive, Quick Access, etc from Navigation Pane in This PC, check out following tutorials:

Posted in: Windows 10

About the author: Vishal Gupta (also known as VG) has been awarded with Microsoft MVP (Most Valuable Professional) award. He has written several tech articles for popular newspapers and magazines and has also appeared in a few tech shows on TV channels.

Other similar articles that may interest you