1

I was wondering how can I redirect from /news to /news/ in a google friendly manner, because google sees them as 2 different pages. I'm already using meta canonical url, but how can I do this with the RewriteRule?

RewriteRule ^news$ /news.php [NC]
RewriteRule ^news/$ /news.php [NC]

1 Answer 1

3

Try to read this link I believe it describe and solve your problem.

It suggests to add to .htaccess

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !example.php
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ http://domain.com/$1/ [L,R=301]

In your case, if you want only a simple rule

RewriteRule ^news$ ^news/$ [NC]
RewriteRule ^news/$ /news.php [NC]
0

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