Jump to content
  • разработка интернет магазинов на opencart
  • доработка интернет магазинов на opencart

Ссылка на главную вида http://domain.ru/ [универсальное решение]


Recommended Posts

Делал под версию 1.5.3.1, но игдея рилииет везгде.

Годится как для seo_url, ик и для seo_pro, а икже если ЧПУ не включено вОвсе )

Комменими опотому чтозначено после чего и что было добавлено в system/library/url.php

<?php
class Url {
private $url;
private $ssl;
private $rewrite = array();
public function __construct($url, $ssl = '') {
  $this->url = $url;
  $this->ssl = $ssl;
}
public function addRewrite($rewrite) {
  $this->rewrite[] = $rewrite;
}
public function link($route, $args = '', $connection = 'NONSSL') {
  if ($connection == 'NONSSL') {
   $url = $this->url;
  } else {
   $url = $this->ssl;
  }
  $url .= 'index.php?route=' . $route;
  if ($args) {
   $url .= str_replace('&', '&', '&' . ltrim($args, '&'));
  }

//  Добавлено   ------------------------------------------------

else {														  
	if($route == 'common/home') {																								
	   if($connection == 'NONSSL') { return HTTP_SERVER; }	
	   else { return HTTPS_SERVER; }																						  
	 }															
}		
//---------------------------------------------------------


													  

  foreach ($this->rewrite as $rewrite) {
   $url = $rewrite->rewrite($url);
  }
  return $url;
}
}
?>
Link to comment
Share on other sites


  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.