CALL (239) 961-8285
ENDURTECH
  • Web Services
    • Web Design
      • Design and Development
      • Web Consulting and Tutoring
      • Hosting and Maintenance
      • Project Portfolio
    • Media
      • Photo and Audio, Video Editing
      • Social Media Management
      • All Web Related Services
    • Marketing
      • Digital Marketing and Branding
      • Search Engine Optimization
    • Client Portal
      • Remote Web Support
      • Web Services Payment
      • Scheduled Payments
  • Tech Support
    • Services
      • Computer Support and Repair
      • Data Backup and Recovery
      • Computer Security, Virus Removal
      • Computer Networking Support
      • Computer Consulting & Tutoring
      • All Technology Related Services
    • Blockchain
      • Blockchain Technology
      • Cryptocurrency Articles
    • Client Portal
      • Remote PC Support
      • Remote Monitoring & Management
      • Tech Services Payment
  • Articles
  • About
  • Talk to Me
  • Menu Menu

Tips for a Secure Apache Web Server Using .htaccess

W3 Total Cache, Web Security, WordPress

Disclaimer: We make no guarantees or warranties with regards to the following tips and suggestions for an Apache .htaccess file regarding security and compression settings.

It is your responsibility to test out these settings on your server and check for comparability and security.

 

Securing Apache Web Server with htaccess

[su_spoiler title=”REVEAL CODE” style=”fancy” icon=”chevron-circle”]

Options All -Indexes
Options -Multiviews
Options +FollowSymLinks

DirectoryIndex index.php index.html index.htm

RewriteEngine On

# Disable public access to your error_log, display 404
RewriteRule (^|/)error_log$ - [L,R=404]
# Use [L,F] flags if you prefer '403 Forbidden' response instead of '404 Not Found'
# Make sure you've set 'RewriteEngine On' prior

[/su_spoiler]

 

While we are at it, let us enable server side GZIP compression of our text, html, javascript, css and xml:

 

[su_spoiler title=”REVEAL CODE” style=”fancy” icon=”chevron-circle”]

# Gzip compression of text, html, javascript, css, xml
AddOutputFilterByType 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

<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf|woff)$">
Header set Cache-Control "max-age=2592000, public"
</FilesMatch>

[/su_spoiler]

 

While we are on the subject of file compression; if you are using WordPress, read our W3 Total Cache plugin settings for optimal operation article.

Don’t forget to lock down this file to prevent others from editing it. See our article about file and folder (CHMOD) permissions.

 

If this article was helpful please take a moment to like us on Facebook, share this on your social media or buy us a cup of coffee.

 

December 10, 2017
Share this entry
  • Share on Facebook
  • Share on X
  • Share on WhatsApp
  • Share on LinkedIn
  • Share on Reddit
  • Share by Mail
https://endurtech.com/wp-content/uploads/2017/12/apache.jpg 512 512 Manny https://endurtech.com/wp-content/uploads/2018/04/endurtech-logo.png Manny2017-12-10 18:04:482023-11-10 05:26:33Tips for a Secure Apache Web Server Using .htaccess
Search Search

CONNECT WITH US

This field is for validation purposes and should be left unchanged.
Engagement*

Want to say, "thanks"?
Leave me a review on Facebook and/or Google.

You can send me a tip using your Brave browser. Get Brave!

Only used to send you a receipt.
Include a Message
Popular
  • Windows Logo
    Second Monitor on Windows 10 Resets After SleepJuly 2, 2020 - 6:30 am
  • Windows Logo
    How to Disable the F1 Help Key in Windows 10April 15, 2021 - 2:40 pm
  • Cortana Logo
    How to Disable Microsoft’s CortanaApril 6, 2021 - 9:00 am
  • Firefox Logo
    How to Remove All Passwords from Lockwise in FirefoxMarch 26, 2020 - 11:00 am
Recent
  • How to Fix Brother BrLog Errors
    How to Fix Brother BrLog ErrorsAugust 24, 2026 - 10:55 am
  • How to block Facebook crawler
    List of Spider Crawlers to BlockAugust 10, 2026 - 9:20 am
  • Brave Browser Logo
    How to Fix the “Not Secure” Address Bar Err...July 20, 2026 - 12:48 pm
  • Linkpull Extension By Endurtech
    LinkPull Extension, Grab Any File From a URLJuly 7, 2026 - 7:35 pm

STAY IN TOUCH

ENDURTECH Web Design Company Naples, Florida

Endurtech GitHub ProfileEndurtech YouTube ChannelEndurtech LinkedIn ProfileEndurtech Facebook Page

5 Star Google Review for Endurtech - Naples Web Design Company

Learn More & Connect

Search Search
ENDURTECH Logo
Endurtech GitHub ProfileEndurtech YouTube ChannelEndurtech LinkedIn ProfileEndurtech Facebook Page

5 Star Google Review for Endurtech - Naples Web Design Company

Latest Articles

  • How to Fix Brother BrLog Errors
    How to Fix Brother BrLog ErrorsAugust 24, 2026 - 10:55 am
  • How to block Facebook crawler
    List of Spider Crawlers to BlockAugust 10, 2026 - 9:20 am
  • Brave Browser Logo
    How to Fix the “Not Secure” Address Bar ErrorJuly 20, 2026 - 12:48 pm
  • Linkpull Extension By Endurtech
    LinkPull Extension, Grab Any File From a URLJuly 7, 2026 - 7:35 pm

Recent Projects

  • Jewelry Website Gems of Note
    Gems of NoteNovember 15, 2019 - 10:16 pm
  • Gift Store Facebook Business Page Cover Video
    Gift Store Facebook Business Page Cover VideoApril 13, 2019 - 3:58 pm
  • Toledo Yoga BrandBot Footer Integration
    Toledo YogaApril 9, 2019 - 7:26 am
  • Lawyer Association Website with Member Portal
    National Employment Lawyers Association, Florida ChapterFebruary 26, 2019 - 8:00 am

Business Details

Mondays - Fridays
9:00 am - 5:00 pm
Eastern Standard Time
After hours by appointment

SUPPORT PHONE

(239) 961-8285

MAILING ADDRESS

59 Logan Ln.
Lynchburg, VA 24502

Copyright © 2026 ENDURTECH ® All Rights Reserved. Legal
Link to: Recommended Settings for W3 Total Cache Plugin for WordPress Link to: Recommended Settings for W3 Total Cache Plugin for WordPress Recommended Settings for W3 Total Cache Plugin for WordPressW3 Total Cache WordPress Plugin Settings Link to: How to Remove an Accidentally Added Word from the Dictionary of Google Chrome Link to: How to Remove an Accidentally Added Word from the Dictionary of Google Chrome Google Chrome LogoHow to Remove an Accidentally Added Word from the Dictionary of Google Chro...
Scroll to top Scroll to top Scroll to top