• Welcome to the Chevereto User Community!

    Here, users from all over the world come together to learn, share, and collaborate on everything related to Chevereto. It's a place to exchange ideas, ask questions, and help improve the software.

    Please keep in mind:

    • This community is user-driven. Always be polite and respectful to others.
    • Support development by purchasing a Chevereto license, which also gives you priority support.
    • Go further by joining the Community Subscription for even faster response times and to help sustain this space

htaccess para imagenes inexistentes??

Status
Not open for further replies.

terrona

Chevereto Member
Hola yo encontré por la red una forma de cuando se elimina una imagen de nuestro servidor, en la web donde esta esa imagen salga una imagen por defecto el problema es que esta configurado para que sea en la raiz del server dentro de publi_html

yo tengo varias carpetas en la raiz del server mi ruta seria /home/user/public_html/carpeta, el código es el siguiente

1º RewriteCond %{REQUEST_FILENAME} !-f
2º RewriteRule ^images/.*\.jpg$ /images/default.jpg [L]

Como podéis ver es solo para imágenes jpg y yo quisiera añadirle gif,png, etc...
A ver si alguien con idea de htaccess me podría decir la configuración correcta.

por ejemplo la ruta seria public_html /chevereto/images
 
Tienes que especificar un Rewritecond con los posibles tipos de archivo, el htaccess final deberia ser algo asi:

Code:
Options +FollowSymLinks
RewriteEngine on
Rewritecond %{REQUEST_FILENAME} !-f 
Rewritecond %{REQUEST_URI} (.*).(gif|jpg|jpeg|png)$
RewriteRule ^(.*) /images/default.jpg

Saludos.
 
Status
Not open for further replies.
Back
Top