.htaccess - URL ReWrite with Toro Script (Force trailing slash) -
i know question over-asked!
but every situation different… , i’m not @ .htaccess modifications.
currently using php index routing script toro. in have .htaccess file includes:
rewriteengine on rewritebase / rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewritecond $1 !^(index\.php) rewriterule ^(.*)$ /index.php/$1/ [l]
how can force url use trailing slash? best solution in getting done don’t have duplicate content on site?
try:
rewriteengine on rewritebase / # redirect trailing slash rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewritecond %{request_uri} !/$ rewriterule ^(.*)$ /$1/ [l,r=301] # old rules, except don't need trailing slash in target rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewritecond $1 !^(index\.php) rewriterule ^(.*)$ /index.php/$1 [l]
Comments
Post a Comment