Web Analytics Made Easy -
StatCounter apache ignoring rewritecond - CodingForum

Announcement

Collapse
No announcement yet.

apache ignoring rewritecond

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • apache ignoring rewritecond

    .htaccess
    Code:
    ############################################
    ## enable rewrites
    
    # For security reasons, Option followsymlinks cannot be overridden.
    #    Options +FollowSymLinks
        Options +SymLinksIfOwnerMatch
        RewriteEngine on
    
    ############################################
    ## you can put here your magento root folder
    ## path relative to web root
    
        RewriteBase /
    
    ############################################
    ## workaround for HTTP authorization
    ## in CGI environment
    
        RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    
    ############################################
    ## always send 404 on missing files in these folders
    
        RewriteCond %{REQUEST_URI} !^/(media|skin|js)/
    
    ############################################
    ## never rewrite for existing files, directories and links
    
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_FILENAME} !-l
    
    ############################################
    ## rewrite everything else to index.php
    
        RewriteRule .* test.php [L]
    
    IndexIgnore *
    i have a file "/admin/manage-categories.php" and it now is showing a "not found" error generated by "/test.php"... why does it even process through test.php i thought those !-f and !-d rewriteconditions were supposed to make it not do that?

    it seems to have started doing this when i added Password Protection to the /admin folder...

  • #2
    test.php is the target of an internal rewrite, so the RewriteCond's don't apply to it.

    The request comes in, if it's not a file, directory or symlink, then it attempts to serve test.php, since this doesn't exist a 404 page is displayed.

    Comment


    • #3
      Originally posted by Cags View Post
      test.php is the target of an internal rewrite, so the RewriteCond's don't apply to it.

      The request comes in, if it's not a file, directory or symlink, then it attempts to serve test.php, since this doesn't exist a 404 page is displayed.
      as i stated in my post, there IS a file at "/admin/manage-categories.php".... and there is no 404 page generated, just a "page not found" message that my "test.php" file generates... but test.php should not even be called for the existing file(s) in /admin/

      Comment

      Working...
      X
      😀
      🥰
      🤢
      😎
      😡
      👍
      👎