Uzman Cevap beta aşamasından çıkmaya hazırlanıyor! Yenilikleri takipte kalın.

seo oluşturucu

merhaba bu seo oluşturucu dosyadan .html yapan yeri silmek istiyorum. nasıl yapabiliri?
<?php
class ControllerStartupSeoUrl extends Controller {

  /***************************
  ***** SeoUrl Functions *****
  ***************************/
  private $urlFriendly = array(
    'common/home'                   => 'index',
    'account/register'              => 'yeni-uyelik',
    'account/login'                 => 'giris',
    'account/logout'                => 'cikis',
    'account/newsletter'            => 'bulten',
    'account/wishlist'              => 'alisveris-listem',
    'account/order'                 => 'siparis-gecmisim',
    'account/account'               => 'hesabim',
    'account/forgotten'             => 'parolami-unuttum',
    'account/download'              => 'siparis-dosyalarim',
    'account/return'                => 'iade-taleplerim',
    'account/transaction'           => 'islemler',
    'account/password'              => 'parola-degistir',
    'account/edit'                  => 'hesabimi-duzenle',
    'account/address'               => 'kayitli-adreslerim',
    'account/reward'                => 'odul-puanlarim',
    'account/return/add'            => 'iade-istegi-gonder',
    'account/voucher'               => 'kupon',
    'information/contact'           => 'iletisim',
    'information/contact/success'   => 'iletisim-gonderildi',
    'information/sitemap'           => 'sitemap',
    'affiliate/register'            => 'create-affiliate-account',
    'affiliate/login'               => 'affiliate-login',
    'affiliate/logout'              => 'affiliate-logout',
    'affiliate/account'             => 'affiliates',
    'affiliate/edit'                => 'edit-affiliate-account',
    'affiliate/password'            => 'change-affiliate-password',
    'affiliate/payment'             => 'affiliate-payment-options',
    'affiliate/tracking'            => 'ffiliate-tracking-code',
    'affiliate/transaction'         => 'affiliate-transactions',
    'affiliate/forgotten'           => 'affiliate-forgot-password',
    'checkout/cart'                 => 'sepetim',
    'checkout/checkout'             => 'odeme-yap',
    'checkout/voucher'              => 'hediye-ceki',
    'product/special'               => 'kampanyali-urunler',
    'product/manufacturer'          => 'markalar',
    'product/compare'               => 'urunleri-karsilastir',
    'product/search'                => 'ara',
  );

  public function getKeyFriendly($_route) {
    if( count($this->urlFriendly) > 0 ){
      $key = array_search($_route, $this->urlFriendly);
        if($key && in_array($_route, $this->urlFriendly)){
          return $key;
        }
    }
    return false;
  }

  public function getValueFriendly($route) {
    if( count($this->urlFriendly) > 0) {
      if(in_array($route, array_keys($this->urlFriendly))){
        return '/'.$this->urlFriendly[$route];
      }
    }
    return false;
  }
  /***************************
  ***** SeoUrl Functions *****
  ***************************/

	public function index() {
		// Add rewrite to url class
		if ($this->config->get('config_seo_url')) {
			$this->url->addRewrite($this);
		}

		// Decode URL
		if (isset($this->request->get['_route_'])) {
      /* SeoUrl remove prefix (*.html) */
      $this->request->get['_route_'] = explode('.', $this->request->get['_route_'], -1);
      $this->request->get['_route_'] = implode('.',$this->request->get['_route_']);
      /* SeoUrl remove prefix (*.html) */
			$parts = explode('/', $this->request->get['_route_']);

			// remove any empty arrays from trailing
			if (utf8_strlen(end($parts)) == 0) {
				array_pop($parts);
			}

			foreach ($parts as $part) {
				$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "url_alias WHERE keyword = '" . $this->db->escape($part) . "'");

				if ($query->num_rows) {
					$url = explode('=', $query->row['query']);

					if ($url[0] == 'product_id') {
						$this->request->get['product_id'] = $url[1];
					}

					if ($url[0] == 'category_id') {
						if (!isset($this->request->get['path'])) {
							$this->request->get['path'] = $url[1];
						} else {
							$this->request->get['path'] .= '_' . $url[1];
						}
					}

					if ($url[0] == 'manufacturer_id') {
						$this->request->get['manufacturer_id'] = $url[1];
					}

					if ($url[0] == 'information_id') {
						$this->request->get['information_id'] = $url[1];
					}

					if ($query->row['query'] && $url[0] != 'information_id' && $url[0] != 'manufacturer_id' && $url[0] != 'category_id' && $url[0] != 'product_id') {
						$this->request->get['route'] = $query->row['query'];
					}
				} else {
					$this->request->get['route'] = 'error/not_found';

					break;
				}
			}

			if (!isset($this->request->get['route'])) {
				if (isset($this->request->get['product_id'])) {
					$this->request->get['route'] = 'product/product';
				} elseif (isset($this->request->get['path'])) {
					$this->request->get['route'] = 'product/category';
				} elseif (isset($this->request->get['manufacturer_id'])) {
					$this->request->get['route'] = 'product/manufacturer/info';
				} elseif (isset($this->request->get['information_id'])) {
					$this->request->get['route'] = 'information/information';
				}
			}
      /* SeoUrl getKeyFriendly */
      if ($_key = $this->getKeyFriendly($this->request->get['_route_']) ) { $this->request->get['route'] = $_key; }
      /* SeoUrl getKeyFriendly  */
			if (isset($this->request->get['route'])) {
				return new Action($this->request->get['route']);
			}
		}
	}

	public function rewrite($link) {
		$url_info = parse_url(str_replace('&amp;', '&', $link));

		$url = '';

		$data = array();

		parse_str($url_info['query'], $data);

		foreach ($data as $key => $value) {
			if (isset($data['route'])) {
				if (($data['route'] == 'product/product' && $key == 'product_id') || (($data['route'] == 'product/manufacturer/info' || $data['route'] == 'product/product') && $key == 'manufacturer_id') || ($data['route'] == 'information/information' && $key == 'information_id')) {
					$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "url_alias WHERE `query` = '" . $this->db->escape($key . '=' . (int)$value) . "'");

					if ($query->num_rows && $query->row['keyword']) {
						$url .= '/' . $query->row['keyword'];

						unset($data[$key]);
					}
				} elseif ($key == 'path') {
					$categories = explode('_', $value);

					foreach ($categories as $category) {
						$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "url_alias WHERE `query` = 'category_id=" . (int)$category . "'");

						if ($query->num_rows && $query->row['keyword']) {
							$url .= '/' . $query->row['keyword'];
						} else {
							$url = '';

							break;
						}
					}

					unset($data[$key]);
				}
        /* SeoUrl getValueFriendly */
        if( $_link = $this->getValueFriendly($data['route']) ) { $url .= $_link; unset($data[$key]); }
        /* SeoUrl getValueFriendly */
			}
		}

		if ($url) {
			unset($data['route']);

			$query = '';

			if ($data) {
				foreach ($data as $key => $value) {
					$query .= '&' . rawurlencode((string)$key) . '=' . rawurlencode((is_array($value) ? http_build_query($value) : (string)$value));
				}

				if ($query) {
					$query = '?' . str_replace('&', '&amp;', trim($query, '&'));
				}
			}
      /* SeoUrl add prefix (*.html) */
			return $url_info['scheme'] . '://' . $url_info['host'] . (isset($url_info['port']) ? ':' . $url_info['port'] : '') . str_replace('/index.php', '', $url_info['path']) . $url . '.html' . $query;
		} else {
			return $link;
		}
	}
}
Cevaplar (2)
0
bu kodu bulun

$url_info['path']) . $url . '.html' . $query;


şöyle değiştirin


$url_info['path']) . $url . $query;
0
Sanırım en alttaki satır da yer alan $url.'.html' ibaresi sebep oluyor
 /* SeoUrl add prefix (*.html) */
			return $url_info['scheme'] . '://' . $url_info['host'] . (isset($url_info['port']) ? ':' . $url_info['port'] : '') . str_replace('/index.php', '',
 $url_info['path']) .$url.'.html'  . $query;
Cevap Yazın..

[code=css,php,sql,asp..]..kod..[/code] , [url=http:...com] , [img=resim linki]
[color=renk kodu]..yazı..[/color]

yabancı dizi izle tv ünitesi