Hi sitepoint users,
I have a problem ,
the problem is that i can’t make permalinks in the way that i want to, i need that mi site work with permalink like this www.mysite.com/eminem/ and i don’t have any success i will ad the code from search.php file and .htaccess
search php file
<?
include 'config.php';
include 'function.php';
$q=$_REQUEST['q'];
$syf=$_REQUEST['syf'];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><?if (empty($q)){echo "Videos - $atitle";}else{echo "$q watch, ".strtoupper($q)." download, listen to".ucwords($q).", $q videos", " Page $syf";} ?></title>
<meta http-equiv="Content-Language" content="en">
<meta name="description" content="<?=$q?> videos, <?=strtoupper($q)?> watch, listen to <?=ucwords($q)?> , <?=$q?> search" />
<meta name="keywords" content="listen to <?=$q?>, <?=strtoupper($q)?> watch, <?=ucwords($q)?> download, <?=strtoupper($q)?> search youtube. " />
<link rel="stylesheet" href="style.css" type="text/css" media="screen" />
<!--[if IE 7]>
<link rel="stylesheet" href="style-ie7.css" type="text/css" media="screen" />
<![endif]-->
<!--[if IE 6]>
<link rel="stylesheet" href="style-ie6.css" type="text/css" media="screen" />
<![endif]-->
</head>
<body>
<div id="main">
<? include 'header.php'; ?>
<div id="content">
<div class="sidebar_left">
<ul>
<li class="categories"><h2>Categories</h2>
<ul>
<?
foreach ($kategori as $sirala){
echo '<li class="cat-item cat-item-55"><a href="./'.$sirala.'&page">'.$sirala.'</a></li>';
}
?>
</div>
<div class="homebody2">
<div class="randomposts">
<h2 class="pagetitle"><?if (empty($q)){echo 'Videos';}else{echo "listen to $q, ".strtoupper($q)." watch video, ".ucwords($q)." download, $q clips";} ?></h2>
<div class="whatsnew">
<h5>Advertisement</h5>
<div id="ads728"></div>
</div>
<?
//Rastgele veri alınıyor
shuffle($anaara);
if (empty($sayfada)){$sayfada='20';}else{$sayfada=$sayfada;}
if (empty($syf)){$syf=1;}else{$syf=$_REQUEST['syf'];}
if ($syf=="1"){
$limit1=1;
}else{
$limit1=($syf*$sayfada);
}
if (empty($q)){$q=$anaara[0];}else{$q=$_REQUEST['q'];}
$listele=$_REQUEST['listele'];
if (empty($listele)){$listele='relevance';}else{$q=$_REQUEST['q'];}
$html=curlspider('http://gdata.youtube.com/feeds/api/videos?q='.urlencode($q).'&orderby='.$listele.'&max-results='.$sayfada.'&start-index='.$limit1.'&format=5');
preg_match_all('#<entry>(.+?)</entry>#smi',$html,$bul);
$bul=$bul[1];
preg_match_all('#<openSearch:totalResults>(.+?)</openSearch:totalResults>#smi',$html,$toplamkayit);
$toplamkayit=$toplamkayit[1][0];
if ($toplamkayit<=0){
echo "Video Bulunamadı";
}
$bulsay=count($bul)-1;
for ($i=0;$i<=$bulsay;$i++){
preg_match_all('#<title type=\\'text\\'>(.+?)</title>#smi',$bul[$i],$title);
$title=$title[1][0];
preg_match_all('#<gd:rating average=\\'(.+?)\\' max=#smi',$bul[$i],$rating);
$rating=$rating[1][0];
preg_match_all('#<published>(.+?)T(.+?)</published>#smi',$bul[$i],$eklenme);
$eklenme=$eklenme[1][0];
preg_match_all('#<media:keywords>(.+?)</media:keywords>#smi',$bul[$i],$etiket);
$etiket=etiket(kisalt($etiket[1][0],150,'...'));
preg_match_all('#<media:description type=\\'plain\\'>(.+?)</media:description>#smi',$bul[$i],$aciklama);
$aciklama=strip_tags($aciklama[1][0]);
preg_match_all('#<media:thumbnail url=\\'(.+?)\\' height=\\'90\\'#smi',$bul[$i],$th);
$th=$th[1][1];
preg_match_all('#<media:category(.+?)>(.+?)</media:category>#smi',$bul[$i],$kategori);
$kategori=$kategori[2][0];
preg_match_all('#<name>(.+?)</name>#smi',$bul[$i],$name);
$name=$name[1][0];
preg_match_all('#countHint=\\'(.+?)\\'/></gd:comments>#smi',$bul[$i],$yorumsay);
$yorumsay=$yorumsay[1][0];
preg_match_all('#viewCount=\\'(.+?)\\'/>#smi',$bul[$i],$viewsay);
$viewsay=$viewsay[1][0];
preg_match_all('#<yt:duration seconds=\\'(.+?)\\'/>#smi',$bul[$i],$sure);
$sure=$sure[1][0];
preg_match_all('#videos/(.+?)</id>#smi',$bul[$i],$vid);
$vid=$vid[1][0];
$kalan=$sure % 60;
if ($kalan=="0"){
$ab=$sure/60;
$sure=''.$ab.':00';
}else{
$ab=(($sure-$kalan)/60);
$sure=''.$ab.':'.$kalan.'';
}
?>
<div class="posts2"><h2></h2>
<div class="postimage">
<a href="<?=seolinkvideo($vid,$title)?>" title="<?=$title?>"><img src="<?=seolinkres($vid,$title)?>" width="120" height="72" alt="<?=$title?>" /></a>
</div>
<div class="postinfo">
<a href="<?=seolinkvideo($vid,$title)?>" title="<?=$title?>"><?=kisalt($title,30,'...');?></a>
</div>
<div class="postviews">
<?=$eklenme?>
</div>
<div class="postviews">
<?=$viewsay?> views
</div>
</div>
<?}?>
<div class="whatsnew">
<h5>Advertisement</h5>
</div></div>
<div id="ads729"></div>
<div id="pagination">
<?
$total_records = $toplamkayit; // toplam veri sayısı
$scroll_page = 15; // kaydırılacak sayfa sayısı
$per_page = $sayfada; // her sayafa gösterilecek sayfa sayısı
$current_page = $_GET['syf']; // bulunulan sayfa
$pager_url = ''.urlencode($q).'&page'; // sayfalamanın yapıldığı adres
$inactive_page_tag = 'syf='; // aktif olmayan sayfa linki için biçim
$previous_page_text = '<'; // önceki sayfa metni (resim de olabilir <img src="... gibi)
$next_page_text = '>'; // sonraki sayfa metni (resim de olabilir <img src="... gibi)
$first_page_text = '<<'; // ilk sayfa metni (resim de olabilir <img src="... gibi)
$last_page_text = '>>'; // son sayfa metni (resim de olabilir <img src="... gibi)
$kgPagerOBJ = new kgPager();
$kgPagerOBJ -> pager_set($pager_url, $total_records, $scroll_page, $per_page, $current_page, $inactive_page_tag, $previous_page_text, $next_page_text, $first_page_text, $last_page_text,$pager_url_last);
echo '<p align="center" id="pager_links">';
echo $kgPagerOBJ -> first_page;
echo $kgPagerOBJ -> previous_page;
echo $kgPagerOBJ -> page_links;
echo $kgPagerOBJ -> next_page;
echo '</p>';
?>
</div>
</div>
</div>
<? include 'footer.php'; ?>
</div>
</body>
<div id="ads728loader" style="display:none;"><? include '728.php'; ?></div>
<script type="text/javascript">
document.getElementById("ads728").innerHTML = document.getElementById("ads728loader").innerHTML;
</script>
<div id="ads729loader" style="display:none;"><? include '728.php'; ?></div>
<script type="text/javascript">
document.getElementById("ads729").innerHTML = document.getElementById("ads729loader").innerHTML;
</script>
</html>
and the .htaccess file
RewriteEngine on
#RewriteBase /
ErrorDocument 404 /404.shtml
RewriteCond %{HTTP_HOST} ^www.mysite.com [NC]
RewriteRule ^(.*)$ http://mysite.com/$1 [L,R=301]
RewriteRule ^videolar.html ara.php [L]
RewriteRule ^contact.html iletisim.php [L]
RewriteRule ^privacy.html privacy.php [L]
RewriteRule ^dmca.html dmca.php [L]
RewriteRule ^links.html links.php [L]
RewriteRule (.*)-(.*).html video.php?vid=$2 [L]
RewriteRule (.*)-(.*).jpg resim.php?res=$2 [L]
RewriteRule ^(.*)&page([0-9]*) ara.php?&q=$1&syf=$2
#cv eski videolar
RewriteRule (.*)!(.*).html video2.php?act=video&vid=$1 [L]
RedirectMatch 301 ^(.*)sex(.*)$ http://mysite.com/
RedirectMatch 301 ^(.*)fight(.*)$ http://mysite.com/
RedirectMatch 301 ^(.*)porn(.*)$ http://mysite.com/
RedirectMatch 301 ^(.*)gilma(.*)$ http://mysite.com/
Thanks in advance