G
G
grigorie19902017-06-05 01:36:05
PHP
grigorie1990, 2017-06-05 01:36:05

.htacces images do not open. How to fix?

Good night)
After transferring the site to the hosting, the pictures stopped opening. You need to fix .haccess. Here is the main page test222.zzz.com.ua/, if you fill out the form and click Preview, the picture should be displayed. Or there should also be pictures on this page test222.zzz.com.ua/tasks/1/name . The site is built according to the mvc structure.
Here is the .haccess:

AddDefaultCharset utf-8

RewriteEngine On
RewriteBase /

RewriteCond %(REQUEST_FILENAME) !-f
RewriteCond %(REQUEST_FILENAME) !-d

RewriteRule ^(.*)$ index.php

I just started to deal with .haccess. Its meaning is that it redirects requests to index.php. The first problem is that after the transfer, the pictures fell off. The second problem is that I also wanted the index2.php file to open (this is for me to login through the dayside panel). How to fix?
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
link_irk, 2017-06-05
@grigorie1990

RewriteCond %(REQUEST_FILENAME) !-f
RewriteCond %(REQUEST_FILENAME) !-d

These directives say that if a request is made to a real-life file (-f) or directory (-d), then the rules will not be applied to it. Accordingly, index2.php in your case should be processed normally (since it is a real file, the rules will not apply to it).
Regarding the pictures, try to specify the path relative to the root. That is, the path should start with "/". Look in the browser debugger on which path it requests images

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question