F
F
fulli2014-08-08 00:41:35
PHP
fulli, 2014-08-08 00:41:35

Url - how to avoid such a problem?

When you follow the link localhost/url/p/article-1 , the get is written localhost/url/p/article-1
And if you follow the link "of this type /article-2" from the same page, then of course the get will become like this localhost/ url/p/article-2 , but it needs to be localhost/php/url/article-2.
The solution to the problem is very simple. Just write a full link, the question is, can I somehow avoid this?
If you use a script that will determine and pass through the location, is it worth the 20-100 saved bytes per link? Or is there an easier way to deal with this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Optimus, 2014-08-08
Pyan @marrk2

I didn’t really understand the whole concept, but 20-100 bytes are definitely not worth it if you don’t have a million of them.

V
Viktor Vsk, 2014-08-08
@viktorvsk

Most likely, you have premature optimization . For starters, try not to think about performance at all, until you clearly see that something is slowing down / running out of memory, etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question