FilesMatch & php .htaccess options

Discussion in 'Bug Reports' started by priestjim, May 25, 2009.

  1. priestjim

    priestjim New Member

    Hi!

    We are experiencing an issue with the FilesMatch directive and the php_* htaccess options.

    A client of ours is using BBClone to monitor his stats but after we switched to LS, the statistics parsing method stopped working. I've pinpointed the error to the .htaccess file he uses:

    Code:
    AddType application/x-httpd-php4 htm html
    <FilesMatch "index.htm">
     php_value auto_append_file "/var/www/vhosts/xxx/httpdocs/count.php"
    </FilesMatch>
    If I remove the FilesMatch directive, everything works fine, but with it on, the count.php file does not get appended!

    Any help would be appreciated.
  2. mistwang

    mistwang LiteSpeed Staff

    php_value inside <FilesMatch> was ignored.
    You can download and try the latest 4.0.4 build, it should work now.
  3. priestjim

    priestjim New Member

    Is it generally working now with directives like "FilesMatch", "Files" and "DirectoryMatch" and options php_flag, php_value, php_admin_flag, php_admin_value, or just FilesMatch and php_value?

    Anyway, thanks for the quick response and fix!
  4. DraCoola

    DraCoola Member

    Thank you for thread starter.
    I am also have a question regarding to .htaccess

    Cpanel always create rewrite rules just like this :
    -----------------------------------------------
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^domain.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.domain.com$
    RewriteRule ^.?$ "http\:\/\/domain\.com\/folder" [R=302,L]
    -----------------------------------------------

    That default Cpanel rules are often (always) makes browser bring Redirect loop error reports with LSWS.




    So I have to always manually edit/simply modify that rules to :
    -----------------------------------------------
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^domain.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.domain.com$
    RewriteRule ^/?$ "http\:\/\/domain\.com\/folder" [R=302,L]
    -----------------------------------------------

    That will work fine with LSWS.

    So the question is :
    How to make LSWS automatically work with default Cpanel redirect rules?
    Because it is so wasting time to manualy edit so many .htaccess, which suppose to be just worked at a time after created from Cpanel.

    Thank you.
  5. mistwang

    mistwang LiteSpeed Staff

    How do you make cPanel create rule like that?

    The default rule does not look right, as it redirects request with "domain.com" to http://domain.com/, so it causes loop redirections.
    I don't know why Apache does not cause loop redirection with it.
    We need to investigate.
  6. DraCoola

    DraCoola Member

    I don't know how, but Cpanel is always create rules just like that when creating redirect from Cpanel's redirect menu.

    The situation is the same way either with old or new hosting account.
    Redirect domain/subdomain/folder to another url will causing redirect loop.

    So everytime after setuping redirect from Cpanel's menu, I have to replace "." with "/" by my self.

    Any clue?
    Or I have to PM my temporary root detail to you so you could investigate this?
  7. DraCoola

    DraCoola Member

    Ramdomly redirect loop victim --> http://audiogazmo.com

    Even mysql.allow persistent turned Off on php ini.

    The .htaccess :
    -----------------------------------------------
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress
    -----------------------------------------------


    The error log from Cpanel :
    -----------------------------------------------
    2009-05-28 08:58:44.888 [INFO] [HTAccess] Updating configuration from [/home1/audiocom/public_html/.htaccess]
    2009-05-28 08:52:28.582 [INFO] [HTAccess] Updating configuration from [/home1/audiocom/public_html/.htaccess]
    2009-05-28 08:50:40.281 [INFO] [HTAccess] Updating configuration from [/home1/audiocom/public_html/.htaccess]
    -----------------------------------------------


    Everyday, twice or more, any of my customers report that their websites cannot open because of Redirect Loop.
    I'm so tired with this many ways of Redirect Loop problems...
    Last edited: May 28, 2009
  8. Tony

    Tony Member

    With wordpress the cause is far more likely in wordpress they have it set to www.audiogazmo.com and the htaccess to audiogazmo.com then you create a loop.

    Maybe not in this case but a lot of the time thats the issue with wordpress.
  9. mistwang

    mistwang LiteSpeed Staff

    Do you mean "Redirects" function in the "domains" section? Or something else?
  10. DraCoola

    DraCoola Member

    Yes, I mean creating redirects from "Redirects" function in the "domains" section

    [​IMG]
  11. mistwang

    mistwang LiteSpeed Staff

    Please download updated 4.0.4 release package.
    Add code to detect loop redirections.
  12. DraCoola

    DraCoola Member

    I already using 4.0.4 before.
    All right then I will download and run upgrade again.
  13. DraCoola

    DraCoola Member

    Definitely not help much...
    Another victim ---> http://slabgames.com

    Everyday, 1-4 per day, I am facing this report from my Redirect Loop customers :(
  14. mistwang

    mistwang LiteSpeed Staff

    I need the whole .htaccess file and what you have to change to fix it. the URL that caused loop redirection.
  15. DraCoola

    DraCoola Member

    The newest victim, reported just few minutes ago ---> http://mp3smackers.com

    And here is the whole .htaccess entry :
    ---------------------------------------------
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress
    ---------------------------------------------

    I didn't change anything to fix that. Just confuse, give up, and waiting for your solution [​IMG]

    The only simple fix I did is just for the default redirect rule from Cpanel.
    ---> http://www.litespeedtech.com/support/forum/showpost.php?p=15371&postcount=4
  16. DraCoola

    DraCoola Member

    Update :

    Replaced with Apache, and then went back to LSWS = cured!

    :confused:
  17. DraCoola

    DraCoola Member

    Update v0.2 :

    While testing from another server :

    LSWS
    [​IMG]


    APACHE
    [​IMG]
    Last edited: May 29, 2009
  18. mistwang

    mistwang LiteSpeed Staff

    It does not make much sense with the information you provided, if that's the whole .htaccess file, how could you fix the redirect rule causing problem if those rules does not even in the .htaccess? :confused:

    I need the exact and complete .htaccess file that causing loop redirections.
  19. mistwang

    mistwang LiteSpeed Staff

    What have you done between update and update v0.2 to make it comes back?
  20. DraCoola

    DraCoola Member

    I thought, if from wordpress case, it doesn't caused by .httaccess.
    As my screen shoots for LSWS and Apache at above, there is "301 moved permanently" that have been makes page redirected in loop.

    I'm Also not doing fixing for anything for that wordpress cases.
    Because I have just replacing each other between apache and LSWS, and then it magically fixed.
    But actually... that's not the permanent fixed.
    Because if it accessed from command line : "HEAD mp3smackers.com", there are still shows for redirect loop.

    So I guest the "finally fixed shown on browser" cames from cache after using Apache temporarily before it went back to LSWS?

Share This Page