Jump to content

.htaccess no muestra CSS ni imagenes solo texto


Recommended Posts

Hola a todos,

 

antes de nada, como siempre, gracias por vuestro tiempo y dedicación a este foro y por tomaros la molestia de leer mi post.

 

Llevo semanas y he leido infinidad de foros, y todo empezó porque quería hacer un vhosts para que mi tienda se viera desde www.midominio.com y no desde www.midominio.com/directorio.

 

Pues bien, esto ya lo consiguo. Luego me topé con el error 500 y el problema de la redirección y el límite LimitInternalRecursion, así que me metí de lleno en el mundo del .htaccess y esto ya ha sido la locura. Después de mucho mucho mucho investigar, no me digáis como, al final conseguí poder ver la tienda, ya redirigida a través de www.midominio.com y sin el error 500, peeeeeeeeeeeeeeeero, el problema ahora es que la tienda si muestra los links, si muestra el texto, pero no saca nada de estilo ni imágenes ni nada, parece que no lee nada de la parte de estilos.

 

Como os digo, muestra los links, y funcionan perfectamente porque puedo navegar por ellos pero es todo texto, nada de estilo.

 

 

He probado 1000 combinaciones y he leido muchísimos foros pero no doy con la solución. Os pongo mi fichero .htaccess por si a alguien se le ocurre algo o ha tenido el mismo problema

 

# ~~start~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again
# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution
 
<IfModule mod_rewrite.c>
<IfModule mod_env.c>
SetEnv HTTP_MOD_REWRITE On
</IfModule>
 
RewriteEngine on
RewriteRule . - [E=REWRITEBASE:/tufullstore/]
RewriteRule ^api/?(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]
 
# Images
RewriteRule ^([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3.jpg [L]
RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$1$2$3$4.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$1$2$3$4$5.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg [L]
RewriteRule ^c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2$3.jpg [L]
RewriteRule ^c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2.jpg [L]
# AlphaImageLoader for IE and fancybox
RewriteRule ^images_ie/?([^/]+)\.(jpe?g|png|gif)$ js/jquery/plugins/fancybox/images/$1.$2 [L]
 
# Dispatcher
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ %{ENV:REWRITEBASE}index.php [NC,L]
RewriteRule . - [E=REWRITEBASE:/tufullstore/]
RewriteRule ^api/?(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]
 
# Images
RewriteRule ^([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3.jpg [L]
RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$1$2$3$4.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$1$2$3$4$5.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg [L]
RewriteRule ^c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2$3.jpg [L]
RewriteRule ^c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2.jpg [L]
# AlphaImageLoader for IE and fancybox
RewriteRule ^images_ie/?([^/]+)\.(jpe?g|png|gif)$ js/jquery/plugins/fancybox/images/$1.$2 [L]
 
# Dispatcher
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ %{ENV:REWRITEBASE}index.php [NC,L]
</IfModule>
 
AddType application/vnd.ms-fontobject .eot
AddType font/ttf .ttf
AddType font/otf .otf
AddType application/x-font-woff .woff
 
<IfModule mod_expires.c>
        ExpiresActive On
        ExpiresByType image/gif "access plus 1 month"
        ExpiresByType image/jpeg "access plus 1 month"
        ExpiresByType image/png "access plus 1 month"
        ExpiresByType text/css "access plus 1 week"
        ExpiresByType text/javascript "access plus 1 week"
        ExpiresByType application/javascript "access plus 1 week"
        ExpiresByType application/x-javascript "access plus 1 week"
        ExpiresByType image/x-icon "access plus 1 year"
        ExpiresByType image/svg+xml "access plus 1 year"
        ExpiresByType image/vnd.microsoft.icon "access plus 1 year"
        ExpiresByType application/font-woff "access plus 1 year"
        ExpiresByType application/x-font-woff "access plus 1 year"
        ExpiresByType application/vnd.ms-fontobject "access plus 1 year"
        ExpiresByType font/opentype "access plus 1 year"
        ExpiresByType font/ttf "access plus 1 year"
        ExpiresByType font/otf "access plus 1 year"
        ExpiresByType application/x-font-ttf "access plus 1 year"
        ExpiresByType application/x-font-otf "access plus 1 year"
</IfModule>
 
<IfModule mod_headers.c>
        Header unset Etag
</IfModule>
FileETag none
<IfModule mod_deflate.c>
        <IfModule mod_filter.c>
                AddOutputFilterByType DEFLATE text/html text/css text/javascript application/javascript application/x-javascript
        </IfModule>
</IfModule>
 
#If rewrite mod isn't enabled
ErrorDocument 404 /tufullstore/index.php?controller=404
 
 
Muchas gracias a todos por vuestra ayuda.
 
 
Link to comment
Share on other sites

Hola a todos de nuevo,

 

no hay nadie que  me pueda ayudar, no le ha pasado a nadie ??? He seguido mirando, y encontré este hilo

 

https://www.prestashop.com/forums/topic/247203-solucionado-url-amigable-y-htaccess-produce-500-internal-error-prestashop-154-en-godaddy/page-2

 

lo he probado tal cual, pero el problema persiste, si que me carga la tienda pero solo texto, ni imagenes ni colores, ni formato, ni columnas ni nada, solo texto. Es desesperante esto. En el caso de la prueba del hilo que pongo arriba, ya no me muestra el error 500, el error es el 404, pero he comprobado en el php y SI que tengo el módulo cargado.

 

Si alguien pudiera ayudarme

Link to comment
Share on other sites

Antes de nada gracias Enrique por la ayuda, y sorry no conocía lo de code <> para siguientes así se hará :-D

 

He habilitado la tienda para que de el fallo

 

www.tufullstore.com

 

o tb

 

www.tufullstore.com/tufullstore que es lo que quiero quitar.

 

Saludos y gracias.

Link to comment
Share on other sites

Gracias Enrique, sigo investigando, no estoy nada ducho en código del .htaccess pero en algún momento daré con ello.

 

Interesante que ya por lo menos me digas que para los CSS no tengo que redirigir nada, como veía que si que había reglas para las fotos, entendía que para los css era igual.

 

muchas gracias de nuevo

Link to comment
Share on other sites

Hola

 

he encontrado buscando alguien que más o menos le pasaba lo mismo, y sin más, como digo no controlo nada, copié el código, lo adapté a mi página, y ahora por lo menos ya si puedo acceder bien a la administración de la tienda, que antes no podía, pero sigo en la tienda o vista de la tienda NO pudiendo ver estilos, ni fotos ni nada, sigue en modo texto y links. ahora me está dando error 404. Que desesperación madre... !!!!!!!!!! 

 

Os pongo lo que me sale en el archivo de error que se crea con el vhosts, un poco denso pero por si acaso tb

[Sat Apr 11 09:51:07.315552 2015] [authz_core:debug] [pid 2728] mod_authz_core.c(802): [client 192.168.1.1:11797] AH01626: authorization result of Require all granted: granted, referer: http://www.tufullstore.com/tufullstore/

[Sat Apr 11 09:51:07.315649 2015] [authz_core:debug] [pid 2728] mod_authz_core.c(802): [client 192.168.1.1:11797] AH01626: authorization result of <RequireAny>: granted, referer: http://www.tufullstore.com/tufullstore/
[Sat Apr 11 09:51:07.315804 2015] [charset_lite:debug] [pid 2728] mod_charset_lite.c(219): [client 192.168.1.1:11797] AH01448: incomplete configuration: src unspecified, dst unspecified, referer: http://www.tufullstore.com/tufullstore/
[Sat Apr 11 09:51:07.315906 2015] [core:info] [pid 2728] [client 192.168.1.1:11797] AH00128: File does not exist: /opt/lampp/htdocs/tufullstore/tufullstore/792-small_default/radio-digital-de-bolsillo-sony-srfm97.jpg, referer: http://www.tufullstore.com/tufullstore/
[Sat Apr 11 09:51:07.316189 2015] [charset_lite:debug] [pid 2728] mod_charset_lite.c(219): [client 192.168.1.1:11797] AH01448: incomplete configuration: src unspecified, dst unspecified, referer: http://www.tufullstore.com/tufullstore/
[Sat Apr 11 09:51:07.330074 2015] [authz_core:debug] [pid 2618] mod_authz_core.c(802): [client 192.168.1.1:11799] AH01626: authorization result of Require all granted: granted, referer: http://www.tufullstore.com/tufullstore/
[Sat Apr 11 09:51:07.330173 2015] [authz_core:debug] [pid 2618] mod_authz_core.c(802): [client 192.168.1.1:11799] AH01626: authorization result of <RequireAny>: granted, referer: http://www.tufullstore.com/tufullstore/
[Sat Apr 11 09:51:07.330351 2015] [charset_lite:debug] [pid 2618] mod_charset_lite.c(219): [client 192.168.1.1:11799] AH01448: incomplete configuration: src unspecified, dst unspecified, referer: http://www.tufullstore.com/tufullstore/
[Sat Apr 11 09:51:07.330454 2015] [core:info] [pid 2618] [client 192.168.1.1:11799] AH00128: File does not exist: /opt/lampp/htdocs/tufullstore/tufullstore/modules/themeconfigurator/img/b661e7124df72f8740e7797e711ee9b6d88e9e6d_certificate-10.jpg, referer: http://www.tufullstore.com/tufullstore/
[Sat Apr 11 09:51:07.330685 2015] [charset_lite:debug] [pid 2618] mod_charset_lite.c(219): [client 192.168.1.1:11799] AH01448: incomplete configuration: src unspecified, dst unspecified, referer: http://www.tufullstore.com/tufullstore/
[Sat Apr 11 09:51:08.323723 2015] [authz_core:debug] [pid 2728] mod_authz_core.c(802): [client 192.168.1.1:11797] AH01626: authorization result of Require all granted: granted
[Sat Apr 11 09:51:08.323802 2015] [authz_core:debug] [pid 2728] mod_authz_core.c(802): [client 192.168.1.1:11797] AH01626: authorization result of <RequireAny>: granted
[Sat Apr 11 09:51:08.323914 2015] [charset_lite:debug] [pid 2728] mod_charset_lite.c(219): [client 192.168.1.1:11797] AH01448: incomplete configuration: src unspecified, dst unspecified
[Sat Apr 11 09:51:08.323993 2015] [core:info] [pid 2728] [client 192.168.1.1:11797] AH00128: File does not exist: /opt/lampp/htdocs/tufullstore/tufullstore/img/favicon.ico
[Sat Apr 11 09:51:08.324154 2015] [charset_lite:debug] [pid 2728] mod_charset_lite.c(219): [client 192.168.1.1:11797] AH01448: incomplete configuration: src unspecified, dst unspecified
 

 

 

Os pongo el código por si sirve

<IfModule mod_rewrite.c>

<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^tufullstore.com$
RewriteRule . - [E=REWRITEBASE:/]
RewriteRule ^api/?(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]
# Images
RewriteCond %{HTTP_HOST} ^tufullstore.com$
RewriteRule ^([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3.jpg [L]
RewriteCond %{HTTP_HOST} ^tufullstore.com$
RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$1$2$3$4.jpg [L]
RewriteCond %{HTTP_HOST} ^tufullstore.com$
RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$1$2$3$4$5.jpg [L]
RewriteCond %{HTTP_HOST} ^tufullstore.com$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg [L]
RewriteCond %{HTTP_HOST} ^tufullstore.com$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg [L]
RewriteCond %{HTTP_HOST} ^tufullstore.com$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg [L]
RewriteCond %{HTTP_HOST} ^tufullstore.com$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg [L]
RewriteCond %{HTTP_HOST} ^tufullstore.com$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg [L]
RewriteCond %{HTTP_HOST} ^tufullstore.com$
RewriteRule ^c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2$3.jpg [L]
RewriteCond %{HTTP_HOST} ^tufullstore.com$
RewriteRule ^c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2.jpg [L]
# AlphaImageLoader for IE and fancybox
RewriteCond %{HTTP_HOST} ^tufullstore.com$
RewriteRule ^images_ie/?([^/]+)\.(jpe?g|png|gif)$ js/jquery/plugins/fancybox/images/$1.$2 [L]
# Dispatcher
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteCond %{HTTP_HOST} ^tufullstore.com$
RewriteRule ^.*$ - [NC,L]
RewriteCond %{HTTP_HOST} ^tufullstore.com$
RewriteRule ^.*$ %{ENV:REWRITEBASE}index.php [NC,L]
</IfModule>
#If rewrite mod isn't enabled
ErrorDocument 404 /index.php?controller=404
# ~~end~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again
Edited by Enrique Engblom
código sin etiquetar (see edit history)
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...