Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

ok, here it goes! im running linux (cent os), my httpd.conf file has the line "LoadModule rewrite_module modules/mod_rewrite.so" enabled! the "mod_rewrite.so" is in the modules folder. here is some code

HTTPD.CONF:

<Directory />
    Options All
    AllowOverride All
</Directory>

<Directory "/var/www/html">
   Options Indexes All
   AllowOverride All
   Order allow,deny
   Allow from all
</Directory>

VHost File:

# owned by VirtualHost
NameVirtualHost 192.168.10.200:80

# FrontPage needs the following four things to be here
# otherwise all the vhosts need to go in httpd.conf, which could
# get very large since there could be thousands of vhosts
ServerRoot /etc/httpd

<VirtualHost 192.168.10.200:80>
ServerName www.site.com
ServerAlias site.com
ServerAdmin admin
DocumentRoot /home/.sites/70/site4/web
ErrorDocument 401 /error/401-authorization.html
ErrorDocument 403 /error/403-forbidden.html
ErrorDocument 404 /error/404-file-not-found.html
ErrorDocument 500 /error/500-internal-server-error.html
RewriteEngine on
RewriteCond %{HTTP_HOST}                !^192.168.10.200(:80)?$
RewriteCond %{HTTP_HOST}                !^www.site.com(:80)?$ [NC]
RewriteRule ^/(.*)                      http://www.site.com/$1 [L,R]
# BEGIN WebScripting SECTION.  DO NOT EDIT MARKS OR IN BETWEEN.
AddHandler cgi-wrapper .cgi
AddHandler cgi-wrapper .pl
AddType application/x-httpd-php .php4
AddType application/x-httpd-php .php
# END WebScripting SECTION.  DO NOT EDIT MARKS OR IN BETWEEN.
RewriteOptions inherit
#AliasMatch ^/~([^/]+)(/(.*))?          /home/.sites/70/site4/users/$1/web/$3
Include /etc/httpd/conf/vhosts/site4.include
# BEGIN Bandwidth SECTION.  DO NOT EDIT MARKS OR IN BETWEEN.
# END Bandwidth SECTION.  DO NOT EDIT MARKS OR IN BETWEEN.
# BEGIN PHP SECTION.  DO NOT EDIT MARKS OR IN BETWEEN.
php_admin_flag safe_mode On
php_admin_flag safe_mode_gid Off
php_admin_value safe_mode_allowed_env_vars PHP_
php_admin_value safe_mode_exec_dir .
php_admin_value safe_mode_include_dir .
php_admin_value safe_mode_protected_env_vars LD_LIBRARY_PATH
php_admin_flag register_globals On
php_admin_flag allow_url_fopen Off
php_admin_flag allow_url_include Off
php_admin_value open_basedir /home/:/tmp/:/var/lib/php/session/:/home/.sites/70/site4/
php_admin_value post_max_size 20M
php_admin_value upload_max_filesize 20M
php_admin_value max_execution_time 120
php_admin_value max_input_time 60
php_admin_value memory_limit 16M
# END PHP SECTION.  DO NOT EDIT MARKS OR IN BETWEEN.
</VirtualHost>
# end of VirtualHost owned section

VHost include File:

# /etc/httpd/conf/vhosts/site4.include
# user customizations can be added here.

.htaccess:

Options -Indexes

RewriteEngine on

what i get no mater what i try:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, admin and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

and here is the apache log:

/home/.sites/70/site4/web/.htaccess: RewriteEngine not allowed here

I hope i provided enuph info.. thx in advance for any help!!

share|improve this question

1 Answer 1

To enable usage of mod_rewrite in a .htaccess file you need to allow override of FileInfo in the directory where the .htaccess file is located.

If you just have "RewriteEngine on" in .htaccess just remove it, it's totally useless as it's already in the vhost configuration.
If you need to add others RewriteCond/RewriteRule in this .htaccess file you have to add AllowOverride FileInfo directive for the /home/.sites/70/site4/web/ directory.

<Directory /home/.sites/70/site4/web>
      AllowOverride FileInfo
</Directory>
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.