Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-18-2009, 11:05 PM   PM User | #1
BatCountry
New Coder

 
BatCountry's Avatar
 
Join Date: Jul 2007
Location: McMaynerberry, Texas
Posts: 57
Thanks: 5
Thanked 0 Times in 0 Posts
BatCountry can only hope to improve
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?
BatCountry is offline   Reply With Quote
Old 03-19-2009, 12:27 AM   PM User | #2
tomws
Senior Coder

 
tomws's Avatar
 
Join Date: Nov 2007
Location: Arkansas
Posts: 2,644
Thanks: 29
Thanked 330 Times in 326 Posts
tomws will become famous soon enoughtomws will become famous soon enough
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?
tomws is offline   Reply With Quote
Old 03-19-2009, 04:30 AM   PM User | #3
BatCountry
New Coder

 
BatCountry's Avatar
 
Join Date: Jul 2007
Location: McMaynerberry, Texas
Posts: 57
Thanks: 5
Thanked 0 Times in 0 Posts
BatCountry can only hope to improve
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?
BatCountry is offline   Reply With Quote
Old 03-19-2009, 01:47 PM   PM User | #4
tomws
Senior Coder

 
tomws's Avatar
 
Join Date: Nov 2007
Location: Arkansas
Posts: 2,644
Thanks: 29
Thanked 330 Times in 326 Posts
tomws will become famous soon enoughtomws will become famous soon enough
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?
tomws is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:47 AM.


Advertisement
Log in to turn off these ads.