[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Funciona en .htaccess pero no en sites-available



Buenas tardes.
Tengo apache2 sobre squeeze.
En /var/www/www.etxea.org/htdocs/.htaccess tengo ...

# Impide listar el directorio si no hay un index.*
IndexIgnore *
<IfModule mod_rewrite.c>
  RewriteEngine on
# Any HTTP request other than those for index.php, images, and robots.txt is treated as a request for your index.php file
  RewriteCond $1 !^(index\.php|images|robots\.txt|user_guide)
  RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>

... y funciona perfectamente.
Lo que quiero es no utilizar .htaccess, es decir, pasar esto a /etc/apache2/sites-available/www.etxea.org, para que (después de hacer a2ensite www.etxea.org y /etc/init.d/apache2 restart) funcione todo de la misma forma que en .htaccess
El contenido de www.etxea.org es el siguiente ...

<VirtualHost *>
    ServerAdmin webmaster@etxea.org
    ServerName  www.etxea.org
    ServerAlias etxea.org

    # Indexes + Directory Root.
    DirectoryIndex index.php index.html
    DocumentRoot /var/www/www.etxea.org/htdocs/
    <Directory “/var/www/www.etxea.org/htdocs/”>
# Permite que todas las directivas .htaccess de ese directorio tengan prioridad sobre las establecidas en el archivo de configuración
        AllowOverride All
        IndexIgnore *
        <IfModule mod_rewrite.c>
        RewriteEngine on
# Any HTTP request other than those for index.php, images, and robots.txt is treated as a request for your index.php file
        RewriteCond $1 !^(index\.php|images|robots\.txt|user_guide)
        RewriteRule ^(.*)$ /index.php/$1 [L]
        </IfModule>
    </Directory>

    # CGI Directory
    ScriptAlias /cgi-bin/ /var/www/www.etxea.org/cgi-bin/
    <Location /cgi-bin>
        Options +ExecCGI
    </Location>

    # Logfiles
    ErrorLog  /var/www/www.etxea.org/logs/error.log
    CustomLog /var/www/www.etxea.org/logs/access.log combined
</VirtualHost>

Sin embargo no funciona. ¿Cual es el problema? ¿El apartado IfModule se coloca ahí o en otro sitio?
Un saludo.


Reply to: