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 1088809
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:07:36+00:00 2026-05-16T23:07:36+00:00

What does this line in .htaccess do, and when would I need it? RewriteRule

  • 0

What does this line in .htaccess do, and when would I need it?

RewriteRule !.(js|css|ico|gif|jpg|png)$ index.php

I’m working with zend and I noticed the .htaccess generated by zend doesn’t have this rule, but I’ve seen a tutorial that has it without explaining why.

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
  • 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-16T23:07:37+00:00Added an answer on May 16, 2026 at 11:07 pm

    It’s a RewriteRule redirecting every request except requests for those file types (js, CSS, icons, GIF/JPG/PNG graphics) to index.php.

    It’s so that requests for static resources don’t get handled by index.php (which is generally a good thing, because starting a PHP instance is expensive.)

    It is however already handled in the code block below. This part:

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

    Excludes the redirection to index.php for files that physically exist ( -s); symbolic links ( -); and existing directories (-d).

    If you use the second block you quote (the one created by Zend), everything’s fine.

    Reference in the Apache manual

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

Sidebar

Related Questions

Why does this line work $('#body-image').css(background-image, 'url('+ backgroundimage +')'); but not this one $('#body-image').css(background-image,
I use this line in my .htaccess file to automatically add a trailing slash
Does this line leak if we remove TextBox from the visual and logical tree?
Why does this line cause a NullPointerException : List<Foo> foos = new ArrayList<Foo>(userDetailsService.getFoos(currentUser)); The
Why does this line yield the Missing $ error: \begin{item} Hello \rightarrow \end{item}
What does this line from the following code sample mean? synchronized (_surfaceHolder) { _panel.onDraw(c);
My question is why does this line - ThreadTest tt = new ThreadTest(); in
Why does this pdo::mysql code crash on windows??? <?php $username = root; $password =
This is part of a code. The question is, does this line $(#b_facetNewChild).button().click(function(){ means
For example, I have this line of code: echo 10359023529 + 0.2137582935; Why does

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.