wordpress+awstats htaccess problem

Discussion in 'Apache' started by ma0, Mar 2, 2007.

  1. #1
    Following various advices I created this .htaccess:
    
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_URI} ^/(stats|awstats|failed_auth\.html)/?(.*)$ [NC]
    RewriteRule ^.*$ - [L]
    </IfModule>
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress
    
    Code (markup):
    The problem is that awstats doesn't load any icon at all. if I try to read them directly with Firefox, I can see the directory, but if I click on a jpb, I got directed back to my blog. I don't understand why, I thought that
    /?(.*)$ 
    Code (markup):
    this part was made to see any file/directory after /awstats/

    Thanks for reading (and replying ;) )
     
    ma0, Mar 2, 2007 IP
  2. clixxer

    clixxer Peon

    Messages:
    47
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    But
    RewriteRule ^.*$ - [L]
    Code (markup):
    denies all access.
     
    clixxer, Mar 2, 2007 IP
  3. ma0

    ma0 Peon

    Messages:
    218
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yes, but how do you express with the first condition

    RewriteCond %{REQUEST_URI} ^/(stats|awstats|failed_auth\.html)/?(.*)$ [NC]
    Code (markup):
    That everything after stats and awstats should be made available?
    Isn't that ?(.*) ?
     
    ma0, Mar 2, 2007 IP
  4. clixxer

    clixxer Peon

    Messages:
    47
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You take them out:
    RewriteCond %{REQUEST_URI} ^/(failed_auth\.html)/?(.*)$ [NC]
    Code (markup):
    The '(', ')' and '?(.*)' may not be necessary anymore.

    Your current rules says to block everything following /stats/ /awstats/ and /failed_auth.html/
     
    clixxer, Mar 3, 2007 IP
  5. ma0

    ma0 Peon

    Messages:
    218
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Well..now I have the following rule(s) on another htaccess file.
    The former I wrote is on the root; this one is inside awstat
    
    AuthType Basic
    AuthUserFile /home/uuuu/xxxxxxx/.htpasswd
    AuthName "Stat area"
    require valid-user
    RewriteEngine  on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^https?://(aaaa\.)?bbbbb.com/?.*$ [NC]
    RewriteRule \.(gif|jpg|jpeg|png|mp3|mpg|avi|mov)$ - [F,NC]
    DirectoryIndex uu.html
    
    Code (markup):
    And I see images. So I think I solved it. But I still don't really get why :)
     
    ma0, Mar 4, 2007 IP