
Redireccionar todo a tráfico seguro / Invalid command ‘RewriteEngine’
20/07/2008Si tras configurar un sitio con una redirección, por ejemplo uno que redireccione todo el tráfico http a https:
pilar002:/etc/apache2/sites-available# cat redir
NameVirtualHost *:80
RewriteEngine on
RewriteLog /var/log/apache2/https_rewrite.log
RewriteLogLevel 1
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [L,R]
Fuente: http://crysol.inf-cr.uclm.es/node/198
Se produce el siguiente error:
pilar002:/etc/apache2/sites-available# /etc/init.d/apache2 restart
Forcing reload of web server (apache2)...Syntax error on line 3 of /etc/apache2/sites-enabled/redir:
Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
failed!
La solución es tan sencilla como cargar el módulo de rewrite:
pilar002:/etc/apache2/mods-available# a2enmod rewrite
Module rewrite installed; run /etc/init.d/apache2 force-reload to enable.
Muchisimas gracias ha sido de muchisima utilidad
🙂
Gracias!!!! me ayudo mucho ! ! !
Gracias por la solución, nunca habia instalado wampserver, pero me esta dando algún dolor de cabeza con este tipo de problemas.