D
D
denism3002017-11-20 11:24:01
PHP
denism300, 2017-11-20 11:24:01

How to remove a duplicate site address when generating a link if ssl is used?

Good day!
There was such a problem: the site address is duplicated when forming a link if ssl is used.
I get the link like this:

$url = JURI::root(). JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' . $product->virtuemart_product_id . '&virtuemart_category_id=' . $product->virtuemart_category_id, true);
$url = str_replace(array('//', 'http:/', '/administrator', '/index.php', '/component/vmtoxls'), array('/', 'http://', '', '', ''), $url);

if ssl is disabled, then everything is ok.
if you enable ssl, then the link looks like: https://site.ru/site.ru/category/product
actually, how to fix it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lazy @BojackHorseman PHP, 2017-11-20
Tag

what a glorious shit code))
add another line
then the devil will break his leg)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question