• 16-09-2023, 10:44:34
    #1
    merhabalar sitedeki .php .html uzantıların gözükmemesi için htaccess'e bazı kurallar yükledim ancak her sayfada çalıştığı gibi sadece index.html'de sorun yaşıyorum, direkt sayfası 404 sayfasına yönlendiriyor. Konu hakkında yardımlarınızı bekliyorum, htaccess kodu aşağıdadır. Bu arada htaccess düzenleme ile ilgili bir bilgim yok, internette bir kaynaktan aldım kodları.

    RewriteEngine On
    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
    # php -- BEGIN cPanel-generated handler, do not edit
    # “ea-php56” paketini varsayılan “PHP” programlama dili olarak ayarlayın.
    <IfModule mime_module>
    AddHandler application/x-httpd-ea-php56 .php .php5 .phtml
    </IfModule>
    # php -- END cPanel-generated handler, do not edit
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^([^.]+)$ $1.php [NC,L]
    
    RewriteEngine on
    RewriteCond %{THE_REQUEST} /([^.]+).php [NC]
    RewriteRule ^ /%1 [NC,L,R]
    
    RewriteCond %{REQUEST_FILENAME}.php -f
    RewriteRule ^ %{REQUEST_URI}.php [NC,L]
    
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^([^.]+)$ $1.html [NC,L]
    
    RewriteEngine on
    RewriteCond %{THE_REQUEST} /([^.]+).html [NC]
    RewriteRule ^ /%1 [NC,L,R]
    
    RewriteCond %{REQUEST_FILENAME}.html -f
    RewriteRule ^ %{REQUEST_URI}.html [NC,L]
  • 16-09-2023, 10:47:55
    #2
    Hocam şu şekilde bir güncellermisin

    RewriteEngine On

    # .php uzantısını için
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME}.php -f
    RewriteRule ^([^.]+)/$ $1.php [L]

    # .html uzantısını için
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME}.html -f
    RewriteRule ^([^.]+).html$ $1.html [L]
  • 16-09-2023, 10:52:01
    #3
    yasarguden adlı üyeden alıntı: mesajı görüntüle
    Hocam şu şekilde bir güncellermisin

    RewriteEngine On

    # .php uzantısını için
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME}.php -f
    RewriteRule ^([^.]+)/$ $1.php [L]

    # .html uzantısını için
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME}.html -f
    RewriteRule ^([^.]+).html$ $1.html [L]
    Hocam bu şekilde index çalışıyor ama dosya uzantılarını yine gösteriyor.
  • 16-09-2023, 10:52:14
    #4
    çok fazla yönlendirme ve RewriteEngine On ve RewriteCond / RewriteRule var. aşağıdaki kodu deneyin.
    RewriteEngine On
    
    # HTTP to HTTPS yönlendirmesi
    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
    
    # .php uzantısını kaldırma kuralı
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME}.php -f
    RewriteRule ^([^\.]+)$ $1.php [NC,L]
    
    # .html uzantısını kaldırma kuralı
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME}.html -f
    RewriteRule ^([^\.]+)$ $1.html [NC,L]