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

  • SEARCH
  • Home
  • 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

I have a .htaccess in my that has this line: RewriteRule ^name/([^/]+)$ login/test.php?test=$1 So
I've this .htaccess file that move all the request to index.php?request=(URI) that elaborates them,
I have this in my .htaccess: RewriteEngine On RewriteBase / RewriteRule ^url/(.*)$ url.php?url=$1 [L]
Why does this line work $('#body-image').css(background-image, 'url('+ backgroundimage +')'); but not this one $('#body-image').css(background-image,
CTRL+down arrow does this, but only 1 line at a time. Is there a
I was just reading this line: The first thing the format() method does is
Object doesn't support this property or method It's this line. pthumb = $(#pthumb).attr(src); Does
Does file_get_contents maintain line breaks? I thought it did but I have tried this:
This StackOverflow answer has an image of KDiff3 highlighting intra-line differences. Does someone know
Why does this line of code <TextBlock Text={Binding Net, StringFormat=c}/> Output the result as

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.