apache - .htaccess Force Trailing Slash Rewrite -


apologies i'm new url rewrites. i've managed rewrite working in conventional sense cannot force have trailing slash.

here code:

rewriteengine on rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewritecond %{request_filename}\.html -f rewriterule ^(.*)$ /$1.html [l,qsa] 

you can try:

rewriteengine on rewritebase /  # add trailing slash non-files rewritecond %{request_filename} !-f rewriterule [^/]$ %{request_uri}/ [l,r=301,ne]  rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewritecond %{request_filename}\.html -f rewriterule ^(.*)/?$ $1.html [l] 

Comments

Popular posts from this blog

How to run C# code using mono without Xamarin in Android? -

html - grunt SVG to webfont -

c# - SharpSsh Command Execution -