mod_rewrite problems with SUSE 11 & .htaccess file

Discussion in 'Server Operation' started by keyvan, Feb 25, 2009.

  1. keyvan

    keyvan New Member

    Hi,

    I am getting a 500 Internal Server error message when trying to load a website with a .htaccess file.

    System Configuration is a fresh install of SUSE 11.1 with ISPConfig 2.2 using the How to build a perfect server instruction.

    Everything works fine except when I try to load a specific .htaccess file on a vhost.

    I have searched the net for a couple of days now and I still can't find a solution, any help would be appriciated.

    Below is my .htaccess file and configuration.

    *** This is the .htaccess file ****

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

    # END WordPress

    *** This is the Apache error log****

    [Wed Feb 25 17:44:03 2009] [error] [client ***.***.***.***] Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden: /srv/www/web2/web/index.php

    ***This is the Vhost_ispconf.conf entry****

    ######################################
    # Vhost: www.blank.com:80
    ######################################
    #
    #
    <VirtualHost 10.10.10.31:80>
    ServerName www.blank.com:80
    ServerAdmin [email protected]
    DocumentRoot /srv/www/web2/web
    ServerAlias blank.com
    DirectoryIndex index.php index.html index.htm index.php5 index.php4 index.php3 index.shtml index.cgi index.pl index.jsp Default.htm default.htm
    ErrorLog /srv/www/web2/log/error.log
    AddType application/x-httpd-php .php .php3 .php4 .php5
    php_admin_flag safe_mode Off
    Alias /error/ "/srv/www/web2/web/error/"
    ErrorDocument 400 /error/invalidSyntax.html
    ErrorDocument 401 /error/authorizationRequired.html
    ErrorDocument 403 /error/forbidden.html
    ErrorDocument 404 /error/fileNotFound.html
    ErrorDocument 405 /error/methodNotAllowed.html
    ErrorDocument 500 /error/internalServerError.html
    ErrorDocument 503 /error/overloaded.html
    AliasMatch ^/~([^/]+)(/(.*))? /srv/www/web2/user/$1/web/$3
    AliasMatch ^/users/([^/]+)(/(.*))? /srv/www/web2/user/$1/web/$3

    <IfModule mod_rewrite.c>
    RewriteEngine on
    options +followsymlinks +symlinksifownermatch
    RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
    RewriteRule .* - [F]
    </IfModule>

    </VirtualHost>
     
  2. falko

    falko Super Moderator ISPConfig Developer

    Delete the .htaccess file and place something like this in the Apache Directives field of that web site in ISPConfig:

    Code:
    <Directory /path/to/directory>
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    AllowOverride All
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    </Directory>
     
  3. keyvan

    keyvan New Member

    Hi,

    So I added the code directly into ISP Config Directives box and the site is now accessible but I can't access the posts.

    Apache Error Message when i try to click on a post.

    [Thu Feb 26 21:59:49 2009] [error] [client 123.123.123.123] File does not exist: /srv/www/web2/web/benihana-ginger-salad-dressing

    Is the mod_rewrite working?
     

Share This Page