Need Help in Htaccess

Discussion in 'Apache' started by seomanualsubmission, Oct 5, 2020.

  1. #1
    I can do coding very well but not much ideas with htaccess.

    One of my client's website is created by other company but there is some issue as below.

    https://www.amerrugs.com/about-amer
    This url is working fine. But when adding slash / at last of URL like
    https://www.amerrugs.com/about-amer/ then its giving internal error. While its working fine with product category means when we are opening category then its redirecting and adding slash (/) automatically https://www.amerrugs.com/power-loom/

    This htaccess code is very new for me ...... So no ideas what i should add or change to fix this. htaccess code is as below

    Options +FollowSymlinks
    
    RewriteEngine on
    
    RewriteCond %{HTTP_HOST} !^www\. [NC]
    
    RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
    RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$
    RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/(?:\ Ballot169)?
    RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
    RewriteRule ^(.*)$ http://localhost/amerrugs/$1 [L,R=301]
    
    
    
    RewriteCond %{HTTPS} on
    
    RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
    RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$
    RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/(?:\ Ballot169)?
    RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
    RewriteRule ^(.*)$ http://localhost/amerrugs/$1 [L,R=301]
    
    ErrorDocument 404 /404.php
    
    
    
    RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
    RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$
    RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/(?:\ Ballot169)?
    RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
    RewriteRule ^(.*)index\.(php|html?)$ /$1 [R=301,NC,L]
    
    
    
    
    RewriteCond %{REQUEST_FILENAME} !-d
    
    RewriteCond %{REQUEST_FILENAME}.php -f
    
    RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
    RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$
    RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/(?:\ Ballot169)?
    RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
    RewriteRule ^(.*)$ $1.php
    
    
    
    # Return 404 if original request is .php
    
    RewriteCond %{THE_REQUEST} "^[^ ]* .*?\.php[? ].*$"
    
    RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
    RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$
    RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/(?:\ Ballot169)?
    RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
    RewriteRule .* - [L,R=404]
    Code (markup):
    Need help of any htaccess expert to fix issue of this website.

    Thanks
    Suraj Anjaana
     
    seomanualsubmission, Oct 5, 2020 IP