T
T
tigra2016-03-15 09:42:26
Yii
tigra, 2016-03-15 09:42:26

How to compare links?

There is a need to compare 2 links.
But I ran into a problem that if you compare them as 2 lines, then, accordingly, any difference will consider them as different links.
How can I correctly compare addresses that essentially lead to the same page, but differ in appearance?
For example:

http://site.ru/index.html, 
http://site.ru/ 
http://site.ru/index
http://site.ru/index.htm 
site.ru/index
etc

Answer the question

In order to leave comments, you need to log in

3 answer(s)
T
tigra, 2016-03-15
@tigroid3

I have come to a decision.)
Just a slash or extension is cut off at the end of compared links

A
amf1k, 2016-03-15
@amf1k

Bring them to the same form, for example site.ru and compare

D
dmitirys, 2016-03-15
@dmitirys

(ru\/?(index|\/))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question