.htaccess directory exclusion

Discussion in 'Apache' started by PalSys, Apr 13, 2007.

  1. #1
    I'm trying to exclude a single directory from WordPress' rewrite rules in my htaccess. The directory that I'm trying to exclude is below the WordPress installation.

    i.e. WordPress is installed at http://www.examplesite.com, and the directory that I'm trying to exclude is http://www.examplesite.com/directory.

    I'm not sure of the syntax I should use...any ideas?
     
    PalSys, Apr 13, 2007 IP
  2. rodney88

    rodney88 Guest

    Messages:
    480
    Likes Received:
    37
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I can't remember the exact code WordPress uses but IIRC it uses two RewriteConds to ensure the requested file was not an existing file/directory, then has a RewriteRule to rewrite everything to the index script. You want to add in another RewriteCond to create another condition so that the rewrite rules only apply if we're not requesting anything from /directory/

    RewriteCond %{REQUEST_URI} !^/directory
     
    rodney88, Apr 13, 2007 IP
  3. Monty

    Monty Peon

    Messages:
    1,363
    Likes Received:
    132
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Monty, Apr 13, 2007 IP