• 23-06-2023, 13:15:15
    #1
    merhabalar. kendi sitemden detay.php sayfasına bir url yönlendrimem var. Bu yönlendirmenin yani url'in sonunda "/" koyarsam beni index.php ye yönlendiriyor.
    Ne yaparsam beni index.php ye yönlendirmemesini sağlayabilirim.
    Htacces kodum.

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^localhost/ [NC]
    RewriteRule ^(.*)$ http://localhost/$1 [L,R=301,NC]
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME}\.php -f
    RewriteRule ^(.*)$ $1.php
    
    RewriteRule ^([^/_.]+)$ detay.php?url=$1 [L,QSA]         (#BU SATIR #BU SATIR)
    RewriteRule ^sayfa/([^/_.]+)$ index.php?page=$1 [L,QSA]
    
    
    #404 hata sayfası yönlendirme kodu
    ErrorDocument 404 http://localhost/
    <IfModule mod_security.c>
    SecFilterEngine Off
    SecFilterScanPOST On
    </IfModule>
  • 23-06-2023, 13:30:29
    #2
    1. htaccess
    RewriteEngine on
    
    RewriteCond %{HTTP_HOST} ^localhost [NC]
    RewriteRule ^(.*)$ http://localhost/$1 [L,R=301,NC]
    
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME}\.php -f
    RewriteRule ^(.*)$ $1.php
    
    RewriteRule ^([^/_.]+)$ /$1/ [L,R=301]
    
    RewriteRule ^([^/_.]+)/$ detay.php?url=$1 [L,QSA]
    RewriteRule ^sayfa/([^/_.]+)$ index.php?page=$1 [L,QSA]
    
    ErrorDocument 404 http://localhost/
    
    <IfModule mod_security.c>
    SecFilterEngine Off
    SecFilterScanPOST On
    </IfModule>
    2. htaccess
    RewriteEngine on
    
    RewriteCond %{HTTP_HOST} ^localhost [NC]
    RewriteRule ^(.*)$ http://localhost/$1 [L,R=301,NC]
    
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME}\.php -f
    RewriteRule ^(.*)$ $1.php
    
    RewriteRule ^hizmet/([^/_.]+)$ hizmet-detay.php?url=$1 [L,QSA]
    RewriteRule ^kurumsal/([^/_.]+)$ kurumsal-detay.php?url=$1 [L,QSA]
    RewriteRule ^referans/([^/_.]+)$ referans-detay.php?url=$1 [L,QSA]
    RewriteRule ^([^/_.]+)$ /$1/ [L,R=301]
    RewriteRule ^([a-zA-Z0-9_-]+)/sayfa/([0-9]+)$ kategori-detay.php?category_url=$1&page=$2 [L,NC]
    
    ErrorDocument 404 http://localhost/
    
    <IfModule mod_security.c>
    SecFilterEngine Off
    SecFilterScanPOST On
    </IfModule>
    Dener misiniz
  • 23-06-2023, 13:49:11
    #3
    Carlos1 adlı üyeden alıntı: mesajı görüntüle
    1. htaccess
    RewriteEngine on
    
    RewriteCond %{HTTP_HOST} ^localhost [NC]
    RewriteRule ^(.*)$ http://localhost/$1 [L,R=301,NC]
    
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME}\.php -f
    RewriteRule ^(.*)$ $1.php
    
    RewriteRule ^([^/_.]+)$ /$1/ [L,R=301]
    
    RewriteRule ^([^/_.]+)/$ detay.php?url=$1 [L,QSA]
    RewriteRule ^sayfa/([^/_.]+)$ index.php?page=$1 [L,QSA]
    
    ErrorDocument 404 http://localhost/
    
    <IfModule mod_security.c>
    SecFilterEngine Off
    SecFilterScanPOST On
    </IfModule>
    2. htaccess
    RewriteEngine on
    
    RewriteCond %{HTTP_HOST} ^localhost [NC]
    RewriteRule ^(.*)$ http://localhost/$1 [L,R=301,NC]
    
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME}\.php -f
    RewriteRule ^(.*)$ $1.php
    
    RewriteRule ^hizmet/([^/_.]+)$ hizmet-detay.php?url=$1 [L,QSA]
    RewriteRule ^kurumsal/([^/_.]+)$ kurumsal-detay.php?url=$1 [L,QSA]
    RewriteRule ^referans/([^/_.]+)$ referans-detay.php?url=$1 [L,QSA]
    RewriteRule ^([^/_.]+)$ /$1/ [L,R=301]
    RewriteRule ^([a-zA-Z0-9_-]+)/sayfa/([0-9]+)$ kategori-detay.php?category_url=$1&page=$2 [L,NC]
    
    ErrorDocument 404 http://localhost/
    
    <IfModule mod_security.c>
    SecFilterEngine Off
    SecFilterScanPOST On
    </IfModule>
    Dener misiniz
    merhaba hocam. direkt www dahi açılmıyor
  • 23-06-2023, 15:01:26
    #4
    Konu Hala Günceldir.
    Temel olarak bir url'in sonuna / ekletme işlemi varsa ou da gösterebilirsiniz. Süper olur.
  • 23-06-2023, 17:23:21
    #5
    Deneyiniz bunu hocam
    RewriteEngine on

    RewriteCond %{HTTP_HOST} ^localhost/ [NC]
    RewriteRule ^(.*)$ http://localhost/$1 [L,R=301,NC]

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME}.php -f
    RewriteRule ^(.*)$ $1.php

    RewriteCond %{REQUEST_URI} !^/detay.php
    RewriteRule ^([^/_.]+)$ detay.php?url=$1 [L,QSA]

    RewriteRule ^sayfa/([^/_.]+)$ index.php?page=$1 [L,QSA]

    # 404 hata sayfası yönlendirme kodu
    ErrorDocument 404 http://localhost/
    <IfModule mod_security.c>
    SecFilterEngine Off
    SecFilterScanPOST On
    </IfModule>
  • 24-06-2023, 09:46:10
    #6
    bolsyazilim adlı üyeden alıntı: mesajı görüntüle
    Deneyiniz bunu hocam
    RewriteEngine on

    RewriteCond %{HTTP_HOST} ^localhost/ [NC]
    RewriteRule ^(.*)$ http://localhost/$1 [L,R=301,NC]

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME}.php -f
    RewriteRule ^(.*)$ $1.php

    RewriteCond %{REQUEST_URI} !^/detay.php
    RewriteRule ^([^/_.]+)$ detay.php?url=$1 [L,QSA]

    RewriteRule ^sayfa/([^/_.]+)$ index.php?page=$1 [L,QSA]

    # 404 hata sayfası yönlendirme kodu
    ErrorDocument 404 http://localhost/
    <IfModule mod_security.c>
    SecFilterEngine Off
    SecFilterScanPOST On
    </IfModule>
    merhaba hocam. maalesef url sonuna / koyunca yönlendirme yiyorum.
  • 24-06-2023, 16:37:39
    #7
    Deneyebilirsiniz:
    RewriteRule ^(.*)([^/])$ detay.php?url=$1 [NC,L]
    Bu arada dosyayı kaydettikten sonra tarayıcı geçmişini temizleyip sonrasında kontrol etmenizi öneririm.
  • 26-06-2023, 09:45:24
    #8
    EfendiBey adlı üyeden alıntı: mesajı görüntüle
    Deneyebilirsiniz:
    RewriteRule ^(.*)([^/])$ detay.php?url=$1 [NC,L]
    Bu arada dosyayı kaydettikten sonra tarayıcı geçmişini temizleyip sonrasında kontrol etmenizi öneririm.
    Merhaba. Evet, kodunuz sonuna / ekletiyor, fakat / ve sonrasında bir yazı yazdığımda 301 e atmaıs gerekmiyor mu? olmayan bir konu.
  • 26-06-2023, 10:10:16
    #9
    RewriteEngine on
    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^(.*)$ http://127.0.0.1/$1 [R,L]

    RewriteCond $1 !^(index.php|resources|robots.txt)
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ detay.php/$1 [L,QSA]

    bunu dener misin




    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^localhost/ [NC]
    RewriteRule ^(.*)$ http://localhost/$1 [L,R=301,NC]
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME}.php -f
    RewriteRule ^(.*)$ $1.php

    RewriteRule ^([^/_.]+)$ detay.php?url=$1 [L,QSA] (#BU SATIR #BU SATIR)
    RewriteRule ^sayfa/([^/_.]+)$ index.php?page=$1 [L,QSA]

    bu satırları silip