0

im trying to correct some URL's that dont have the / at the end,

for example, expressionengine created the url without the / however, im trying to redirect whereas all my URls are consisten with the / at the end.

problem is I already have ranking on the non / urls and now showing up duplicate content with urls listing the / at the end.

what kind or redirect 301 should I do.

ive tried this with no luck.

redirect 301 /products/item http://www./products/item/

it wont work in my .htaccess file.

any sugestions

1 Answer 1

1

A 301 (permanent redirect) is the best option and if you want to do it across the board on your site then try this in your .htaccess file:

<IfModule mod_rewrite.c>
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/|#(.*))$
  RewriteRule ^(.*)$ /$1/ [R=301,L]
</IfModule>

This will append the forward slash onto directories but not filenames and set it as a 301.

You can also use rel="canonical" on existing links which works similarly to a 301 in terms of search engine indexing.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.