V
V
Vlad2018-07-12 18:50:36
htaccess
Vlad, 2018-07-12 18:50:36

How to make pretty links in .htaccess?

Hello, I've been struggling with redirecting to url via .htaccess for a day now, maybe a trifling problem, but I really don't know how to solve it.
I have a link knowhome12.locale/news.php?id=32 and I want to change it to knowhome12.locale/news/32 , actually I already did that but when I want to go from this link let's say to this (from the news/32 page), I get this knowhome12.locale/news/news/33
My php code (when going to news/32): When going to news/33, the code is the same, but already from the news/32 page . I don’t know how to solve this problem, I searched everything, but I didn’t find it, thanks in advance.
echo '<a href="news/'.$row['id'].'">Ссылка</a>';

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2018-07-12
@Chizazavr

echo '<a href="news/'.$row['id'].'">Ссылка</a>';
htmlbook.ru/html/a/href

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question