• 04-09-2021, 21:00:33
    #1
    Herkese merhaba arkadaşlar. Ben 1 php dosyası yapacaktım mesele a.php olsun ve sitem test.com olsun. Benim istediğim bu php dosyasının içinde yonlendir.com?public_key= olsun.

    Benim istediğim test.com/a.php?ekle=3UPrkmJrL2Ehaw böyle sonuç girdiğimde yonlendir.com?public_key=3UPrkmJrL2Ehaw bu sayfada link var benim istediğim bu sayfadaki linke yönlendirsin.

    Biraz karışık oldu onun için özür dilerim. Böyle bir kod var tam çözemedim yardımcı olur musunuz bunu nasıl ayarlayacam (çalıştırılacam)

    <?php
    function ya_link( $url){
     $url = "https://yonlendir.com?public_key=" . urlencode( $url );
     $options = array(
             CURLOPT_RETURNTRANSFER => true,     // return web page
             CURLOPT_FOLLOWLOCATION => true,     // follow redirects
             CURLOPT_ENCODING       => "",       // handle all encodings
             CURLOPT_AUTOREFERER    => true,     // set referer on redirect
             CURLOPT_CONNECTTIMEOUT => 12,       // timeout on connect
             CURLOPT_TIMEOUT        => 12,       // timeout on response
             CURLOPT_MAXREDIRS      => 10,       // stop after 10 redirects
         //  CURLOPT_HTTPHEADER => array('Authorization:TOKEN'), //Send Disk access token
      CURLOPT_SSL_VERIFYPEER => false     // Disabled SSL Cert checks
         );
        $ch = curl_init( $url );
        curl_setopt_array( $ch, $options );
        $content = curl_exec( $ch );
        curl_close( $ch );
        $json = json_decode($content);
        if(isset($json->href))
         return $json->href;
        else
         return '';
    }
  • 04-09-2021, 23:23:52
    #2
    Linux tabanlı sistem ise .htaccess üzerinden 301 yönlendirme yapmayı deneyebilirsiniz.
    bu şekilde
    RewriteEngine On
    RewriteRule ^eski-url.html(.*)$ /yeni-url.html [L,R=301]