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 4 of 4
  1. #1
    New Coder BatCountry's Avatar
    Join Date
    Jul 2007
    Location
    McMaynerberry, Texas
    Posts
    57
    Thanks
    5
    Thanked 0 Times in 0 Posts

    HTAccess and Accessing File directories

    Hi,
    I have a wordpress blog and I have folder called data that needs to be accessible, the problem is my url rewrite is not allowing access.

    Because of url rewriting it things that the url to the directory needs to be re-writen and thus it can't find it.

    For example I have urls like this: http://www.domain.com/this-is-a-post
    But when I visit http://www.domain.com/data/file.php (file.php exists inside a folder called data in the root of my host) - i can't access it because it thinks it's a rewritten url.

    Here's my htaccess, I'm pretty sure it's correct:
    Code:
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    anyone know why it's not working?

  • #2
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    Does it bring up a 404 or other error code, or does it just redirect to the index page? I don't have any problems doing the same thing in Drupal, and I'd expect that Wordpress would be as usable.

    Here's the relevant portion of htaccess for a Drupal site:
    Code:
      # Rewrite URLs of the form 'x' to the form 'index.php?q=x'.
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_URI} !=/favicon.ico
      RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
    You might also check for any FilesMatch or Directory blocks that match the directory you're trying to reach.
    Are you a Help Vampire?

  • #3
    New Coder BatCountry's Avatar
    Join Date
    Jul 2007
    Location
    McMaynerberry, Texas
    Posts
    57
    Thanks
    5
    Thanked 0 Times in 0 Posts
    it brings up the 404 message that the post doesn't exist - obviously.

    how do I do the filesmatch?

    I was thinking maybe I could put an htaccess file in the directory to stop urls from being rewritten or something - does that make sense?

  • #4
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    I don't know if you can get it to recognize the reversal of rewriting after it's already bee rewritten. Might work, but I don't have experience to know.

    This man page for Apache 2.2 has Files/FileMatch as well as Directory/DirectoryMatch.

    Also, a quick Google search found this link that may have exactly what you're looking for. Halfway down the page there's a section that says something about turning off wordpress htaccess rewriting for a subdirectory.
    Are you a Help Vampire?


  •  

    Posting Permissions

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