Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6351681
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:03:11+00:00 2026-05-24T22:03:11+00:00

Here are all my rules with comments: <Directory /home/*/public_html> # prevent directory browsing Options

  • 0

Here are all my rules with comments:

<Directory /home/*/public_html>
    # prevent directory browsing
    Options All -Indexes

    # prevent access to htaccess files anywhere on the site
    <Files .htaccess>
        order allow,deny
        deny from all
    </Files>

    # prevent DIRECT access to the /inc/ directory and its PHP files
    <Files ~ "\.inc$">
        order allow,deny
        deny from all
    </Files>

    # custom error documents
    ErrorDocument 400 /error/400.html
    ErrorDocument 401 /error/401.html
    ErrorDocument 403 /error/403.html
    ErrorDocument 404 /error/404.html
    ErrorDocument 500 /error/500.html

    # security requirement of the rewrite engine
    Options +FollowSymLinks

    # turn on rewrite engine
    RewriteEngine On

    # remove PHP extension
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME}\.php -f
    RewriteRule ^(.*)$ $1.php
</Directory>

and

<Directory /home/*/public_html/images>
    # caching
    <IfModule mod_expires.c>
    ExpiresActive On

    <FilesMatch "\.(jpg|jpeg)$">
            ExpiresDefault "modification plus 1 year"
            Header set Cache-Control: "public, max-age=31536000"
            Header unset Last-Modified
        </FilesMatch>
    </IfModule>

    # turn on rewrite engine
    RewriteEngine On

    RewriteCond %{REQUEST_FILENAME} -s [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ - [NC,L]

    # if file cannot be found
    RewriteRule ^.*$ /empty.jpg [NC,L]
</Directory>

Can I add these rules as they are to the bottom of my httpd.cnf? Or are there any mistakes? Or anything else I need to pay attention to? I don’t want to screw anything up, even tho I’m just running my code on my localhost.

Any help would be appreciated. Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T22:03:12+00:00Added an answer on May 24, 2026 at 10:03 pm

    you can put them in httpd.cnf file! and they will work! The only thing you should pay attention is that to put them in right place(e.g in right site)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have all my rewrite rules setup and working in .htaccess but I need
I just tried to add the following htaccess rules to redirect all https urls
enter code here Hi All, I have a simple windows service application that connects
I have carried the method here on almost all of the areas where I
Here the total height of all <div> 's are 900 pixels, but the jQuery
Here's the goal: to replace all standalone ampersands with &amp; but NOT replace those
Here's a simple (hopefully) L10N question: Do all locales want this format: Sunday, Nov
Here is the problem: We have all of our development under subversion, but our
Here is my implementation in summary 1) all DAOs implemented using HibernateDAO support/ @Transational
Here are a few possibilities to get the conversation started: Escape all input upon

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.