Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Oct 2003
    Posts
    603
    Thanks
    2
    Thanked 1 Time in 1 Post

    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
    New Coder
    Join Date
    Jul 2011
    Posts
    67
    Thanks
    0
    Thanked 13 Times in 13 Posts
    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.

  • #3
    Regular Coder
    Join Date
    Oct 2003
    Posts
    603
    Thanks
    2
    Thanked 1 Time in 1 Post
    Quote 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/


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •