PDA

View Full Version : mod_rewrite problems with SUSE 11 & .htaccess file


keyvan
25th February 2009, 22:57
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 webmaster@blank.com
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>

falko
26th February 2009, 21:32
Delete the .htaccess file and place something like this in the Apache Directives field of that web site in ISPConfig:

<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>

keyvan
27th February 2009, 00:25
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?