• 03-01-2014, 23:30:40
    #1
    .htaccess
    Options +FollowSymLinks
    Options All -Indexes
    
    Options +FollowSymLinks
    RewriteEngine On
    RewriteRule ^products/([0-9]+)-([^/]+)\/  product.php?id=$1&baslik=$2[L]
    RewriteRule ^pages/(.*)/$ index.php?sayfa=$1 [L]
    RewriteRule ^([^/]+)/page/([^/]+)/$ category.php?sef=$1&sayfa=$2 [L] 
    RewriteRule ^([^/]+)/$ category.php?sef=$1 [L] 
    RewriteRule ^search/page/([0-9]+)/$ search.php?sayfa=$1 [L,NC] 
    RewriteRule ^search search.php [L,NC] 
    
    RewriteRule ^register register.php [L,NC] 
    RewriteRule ^cart cart.php [L,NC] 
    RewriteRule ^account checkout.php [L,NC] 
    RewriteRule ^logout logout.php [L,NC] 
    RewriteRule ^orders orders.php [L,NC] 
    RewriteRule ^order-history order-history.php [L,NC] 
    RewriteRule ^sitemap.xml sitemap.php [L,NC]
    sorunum şu.
    örnek url:
    http://localhost/proje/product/id-urunsef/ şeklinde bir hiyerarşim var.

    fakat kategori sayfamda ki hiyerarşim farklı
    örnek url: http://localhost/proje/kategorisef/

    kategori sayfam ile arama sayfam birbirine karışıyor.
    bunu nasıl engelleyebilirim.

    .htaccess te sayfa önceliği nasıl olur?
  • 04-01-2014, 00:55:15
    #2
    Üyeliği durduruldu
    RewriteRule ^products/([0-9]+)-([^/]+)/$ product.php?id=$1&baslik=$2[L]
    RewriteRule ^pages/(.*)/$ index.php?sayfa=$1 [L]
    RewriteRule ^search/page/([0-9]+)/$ search.php?sayfa=$1 [L,NC]
    RewriteRule ^search search.php [L,NC]
    RewriteRule ^([^/]+)/page/([^/]+)/$ category.php?sef=$1&sayfa=$2 [L]
    RewriteRule ^([^/]+)/$ category.php?sef=$1 [L]


    htaccess yukarıdan aşağı doğru geçerlilik kazanır.

    htacces dosyanıza göre http://localhost/proje/product/id-urunsef/ bu linkin çalışmıyor olması lazım http://localhost/proje/products/id-urunsef/ şeklinde olmalıdır
  • 04-01-2014, 01:07:07
    #3
    madly0011 adlı üyeden alıntı: mesajı görüntüle
    RewriteRule ^products/([0-9]+)-([^/]+)/$ product.php?id=$1&baslik=$2[L]
    RewriteRule ^pages/(.*)/$ index.php?sayfa=$1 [L]
    RewriteRule ^search/page/([0-9]+)/$ search.php?sayfa=$1 [L,NC]
    RewriteRule ^search search.php [L,NC]
    RewriteRule ^([^/]+)/page/([^/]+)/$ category.php?sef=$1&sayfa=$2 [L]
    RewriteRule ^([^/]+)/$ category.php?sef=$1 [L]


    htaccess yukarıdan aşağı doğru geçerlilik kazanır.

    htacces dosyanıza göre http://localhost/proje/product/id-urunsef/ bu linkin çalışmıyor olması lazım http://localhost/proje/products/id-urunsef/ şeklinde olmalıdır
    pardon hocam çalışıyor da konuyu açarken products yanlış yazmışım. Peki .htaccess bayrakları doğru mu ? [L],[L,NC] gibi ?
  • 04-01-2014, 01:25:48
    #4
    Üyeliği durduruldu
    L: Bu rewriterule’ın son yönlendirme olduğunu söyler. Eğer bu bayrak olmazsa mod_rewrite maxredirects değişkeniniz doğrultusunda sürekli yönlendirme yapacaktır.
    NC: büyük küçük ayrımı yapmadan rewrite yapar.

    ne yaptığını bilirsen bayraklarla pek sorun yaşamazsın
  • 04-01-2014, 11:26:03
    #5
    Teşekkürler