Friendly URL, images do not appear even putting absolute path

3

I'm facing this problem with my friendly URL, even putting the absolute path does not show the images. However the images that are in a folder in the same location as .htacess usually appear, the ones that do not appear are the ones in the admin/imgsupload directory.

I have also tried to use another configuration in the htacess and the base tag, but without success, remembering that it is only giving this problem in the images that are in the admin/imgsupload directory, which is in the same folder as .htacess .

Here are the codes of my htacess and how I am putting the images:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /projetolcj/
RewriteCond %{REQUEST_FILENAME} \.(jpg|gif|jpeg|png|js|css|swf|ico|txt|pdf|xml|woff)$
RewriteRule ^ - [L]
RewriteRule ^(.*) url.php
</IfModule>

Img:

<img src="/projetolcj/admin/<?php echo $linha["imagem"]; ?>" alt="parceiro" class=" thumbnail img-responsive">
    
asked by anonymous 25.09.2015 / 19:15

2 answers

2

Put this in the head of the site: <base href="http://localhost/Sua_Pasta/"> if you are working locally or <base href="http://seusite.com/"> if you already have them in the hosting

    
28.12.2016 / 02:12
1

I believe this way you will release the files you need:

<IfModule mod_rewrite.c>
 RewriteEngine On
 RewriteBase /projetolcj/
 #acessa as requisições abaixo
 #se for um arquivos vazio
 RewriteCond %{REQUEST_FILENAME} -s [OR]
 #ou se for um link de referência (simbólico)
 RewriteCond %{REQUEST_FILENAME} -l [OR]
 #ou se for um diretório
 RewriteCond %{REQUEST_FILENAME} -d
 RewriteRule ^ - [L]
 RewriteRule ^(.*) url.php
</IfModule>

But if you want to only release these files from the list, then do so:

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /projetolcj/
  #ignora todas as regras abaixo quando for arquivo 
  RewriteCond %{REQUEST_FILENAME} !-f
  #ignora todas as regras abaixo quando for diretório 
  RewriteCond %{REQUEST_FILENAME} !-d
  #qualquer coisa que contenha as extensões abaixo não serão tratadas pelas regras a seguir, somente nesta condição
  RewriteCond $1 !^(\.jpg|\.gif|\.jpeg|\.png|\.js|\.css|\.swf|\.ico|\.txt|\.pdf|\.xml|\.woff)
  RewriteRule ^ - [L]
  RewriteRule ^(.*) url.php
</IfModule>

To edit the permissions on Linux:

Directory:

user@host:/projeto/imagens$ sudo chmod 775 -R ./

Files:

user@host:/projeto/imagens$ sudo chmod 664 ./

To edit the permission on Windows watch this video .

    
25.09.2015 / 20:10