A
A
aornos2015-03-11 17:52:24
PHP
aornos, 2015-03-11 17:52:24

$_SERVER['REQUEST_URI] contains strange data, how to fix it?

Good afternoon.
Routing is carried out on the site, the data is taken from $_SERVER['REQUEST_URI'].
The controller is called on the first element, and the action must be called on the second.
Links like site.com/main or site.com/catalog are parsed normally, the appropriate controllers are called (main, catalog, etc.).
The problem arises with the second parameter. The idea is that a link like site.com/catalog/productsType1 should be parsed to catalog and productsType1.
For some reason, a link like /catalog/productsType1 comes to the router from the shared directory as
/catalog/application/css/mycss.css
Need help.
sources:
htaccess
--------------------
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [L]
------------
directory links look like:

"<a href='catalog/" . $value['itemTranslit'] . "'>" . $value['itemTitle'] . "</a>"

It is not clear why they are transformed into /catalog/application/css/mycss.css
Which way to dig?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Burov, 2015-03-11
@aornos

in templates, you need to specify absolute paths to css files. These are the ones that end up in index.php.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question