php - htaccess - Forcing trailing slash but exempt .shtml files -
i tried following code force trailing slash on website:
rewriteengine on rewritecond %{request_filename} !-f rewriterule ^(.*)([^/])$ /$1$2/ [l,r=301]
and works when went page should throw 404, redirecting me www.domain.com/404.shtml
goes in redirect loop.
the site is: http://www.shivampaw.com
i have removed above code htaccess still need trailing slash forced.
my full htaccess rewrite rules:
rewriteengine on rewritecond %{http_host} !^$ rewritecond %{http_host} !^www\. [nc] rewritecond %{https}s ^on(s)| rewriterule ^ http%1://www.%{http_host}%{request_uri} [r=301,l] options +followsymlinks rewriteengine on rewritecond %{script_filename} !-d rewritecond %{script_filename} !-f rewriterule ^services(/)*$ ./services.php rewriterule ^contact(/)*$ ./contact.php rewriterule ^about(/)*$ ./about.php rewriterule ^work(/)*$ ./work.php rewriterule ^work/prima-healthcare(/)*$ ./my-work/primahc.php rewriterule ^work/medical-studies-europe(/)*$ ./my-work/mse.php rewriterule ^work/rowley-village-nursery(/)*$ ./my-work/rvn.php
the question is: how can force trailing slash without affecting clean urls rewrite rules