Understanding this generated .htaccess file and solving my problem_

0

I've downloaded and installed some software on a web server which seems to have generated an .htaccess file in my root folder. I didn't care at first, until I realized I wasn't able to navigate to certain pages in other directories.

I figured it had to be an .htaccess thing, so I found the one in my root folder and here it is:

<IfModule mod_rewrite.c>
    SetEnv HTTP_F_URL On
    RewriteEngine on
    # You may need to set the RewriteBase to point to the root of your
    # Fruml installation if you get HTTP 500 errors.
    # RewriteBase /dev
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php?cmd=$1 [QSA,L]
</IfModule>

<IfModule mod_expires.c>
    SetEnv HTTP_EXPIRES On
    ExpiresActive On
    ExpiresByType image/gif A5184000
    ExpiresByType image/png A5184000
    ExpiresByType image/jpeg A5184000
    ExpiresByType application/x-javascript A5184000
    ExpiresByType application/javascript A5184000
    ExpiresByType text/css A5184000
</IfModule>

<IfModule mod_deflate.c>
    # Insert filter
    SetOutputFilter DEFLATE

    # Netscape 4.x has some problems...
    BrowserMatch ozilla/4 gzip-only-text/html

    # Netscape 4.06-4.08 have some more problems
    BrowserMatch ozilla/4\.0[678] no-gzip

    # MSIE masquerades as Netscape, but it is fine
    # BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

    # NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
    # the above regex won't work. You can use the following
    # workaround to get the desired effect:
    BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html

    # Don't compress images
    SetEnvIfNoCase Request_URI \
    \.(?:gif|jpe?g|png)$ no-gzip dont-vary

    # Make sure proxies don't deliver the wrong content
    Header append Vary User-Agent env=!dont-vary
</IfModule>

the file I'm trying to get to:

[institutum /home/public]$ ls
Fruml+0.0.14            db                      forum_backup.tar        img
LICENSE.txt             forum                   fruml                   index.php
[institutum /home/public]$ cd db      
[institutum /home/public/db]$ ls
admin   bio     chm     eng     mat     phy
[institutum /home/public/db]$ cd admin
[institutum /home/public/db/admin]$ ls
xoda-0.3.1              xoda-0.3.1.tar.bz2
[institutum /home/public/db/admin]$ cd xoda-0.3.1
[institutum /home/public/db/admin/xoda-0.3.1]$ ls
README                  functions.php           js                      xd_icons
config.sample.php       index.php               style.css               zipstream.php
[institutum /home/public/db/admin/xoda-0.3.1]$ 

index.php in the xoda folder.

Renaming .htaccess in my root folder makes other links fail.

I found another .htaccess file in my db folder:

php_flag allow_call_time_pass_reference Off
php_value error_reporting 2047
php_flag magic_quotes_gpc Off
php_flag register_globals Off
php_flag short_open_tag Off
php_flag zend.ze1_compatibility_mode On

n0pe

Posted 2011-07-05T02:40:55.583

Reputation: 14 506

What software did you install? – evan.bovie – 2011-07-05T02:50:48.123

It's called Fruml. A content management system. – n0pe – 2011-07-05T02:52:16.630

What happens if you remove the file? Most of these directives are cosmetic for a personal project. – evan.bovie – 2011-07-05T02:57:48.870

I'm going to try renaming it to .htaccess_bak, however I don't want to remove some useful definitions here which might protect me. – n0pe – 2011-07-05T02:58:49.030

What aren't you able to access, specifically? – BenGC – 2011-07-05T02:59:22.460

Renaming the file renders the site useless (index loads but all links fail). – n0pe – 2011-07-05T03:01:52.007

@BenGC, emb1995: updated question – n0pe – 2011-07-05T03:04:20.180

Answers

0

Try adding RewriteRule ^(db/admin/xoda-0.3.1) - [L] to the mod_rewite section before the other RewriteRule directives:

<IfModule mod_rewrite.c>
    SetEnv HTTP_F_URL On
    RewriteEngine on
    # You may need to set the RewriteBase to point to the root of your
    # Fruml installation if you get HTTP 500 errors.
    # RewriteBase /dev
    RewriteRule ^(db/admin/xoda-0.3.1) - [L]
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php?cmd=$1 [QSA,L]
</IfModule>

Andrew Lambert

Posted 2011-07-05T02:40:55.583

Reputation: 7 136

That didn't work but I found another .htaccess in my db folder. See my question for the code. – n0pe – 2011-07-05T11:37:46.073

Oh and when I said it doesn't work, I meant I get a 404 error. – n0pe – 2011-07-05T11:39:59.893