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

r - Trouble relying on third party package imports in my package -

Payment information shows nothing in one page checkout page magento -