C
C
CatherineGauss2015-09-23 12:21:00
PHP
CatherineGauss, 2015-09-23 12:21:00

Why is $_SERVER['REQUEST_URI'] grabbing extra urls?

I do an Insert into the base of the current url, in addition to it, a link to the favicon and some banners climbs.
I tried to make an exception for these links - nothing changes
. What could be the problem

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Igor Makarov, 2015-09-23
@onqu

Most likely on the server (apache, nginx) there is a redirect to your script (rewrite) if the file is not found, and you write all requests in a row.

P
Pavel Volintsev, 2015-09-23
@copist

In your web server rules, redirect requests for static (CSS and images) to PHP. Just give 404 Page Not Found.
For example, for the nginx web server, conditionally:

# Не перенаправлять запросы про несуществующие статические файлы в PHP
location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|woff|ttf|eot|svg)$ {
    root /var/www/applicaion; # путь к приложению
    access_log off; # логи не писать
    try_files $uri =404; # не вызывать PHP
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question