Question about htaccess

mpsheng

Newbie
Joined
Apr 13, 2010
Messages
46
Reaction score
5
I hope someone can help me with these questions. Thanks in advance for reading!

1. My CMS can automatically create http://www.example.com/content.php?sid=282, but I want users to link to (and see) http://www.example.com/Cool-Page. I added the following line into .htaccess

RewriteRule ^Cool-Page$ http://www.example.com/content.php?sid=282 [R=301,L]

The problem is, whenever someone goes to /Cool-Page, the URL in the address bar still shows content.php?sid=282 instead of /Cool-Page. Is there any way to fix this in an SEO friendly matter?

2. I have several ways to describe a single page. For example, a product might fall into 2 categories:

http://www.example.com/Cat-1/Product.html and
http://www.example.com/Cat-2/Product.html

My CMS automatically creates the second Cat-2/Product.html page based on a product being added into 2 categories. Can htaccess help here to get rid of the second (duplicate content page) or should I fix the URL problem by removing the /Cat-2/Product.html directly?
 
# SEO URL Settings
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\?*$ index.php?_route_=$1 [L,QSA]

I think you can do it
 
You didn't mention what CMS you are using - you should be able to add a canonical meta tag to one of those pages and you're golden. Just google "canonical tags" and you get loads of examples.
 
I have read that canonical doesn't work very well because you are still splitting the incoming links between the 2 pages.

Although Google will "reconcile" the two pages, there is no guarantee that it won't lose some link juice during the reconciliation.
 
You didn't mention what CMS you are using - you should be able to add a canonical meta tag to one of those pages and you're golden. Just google "canonical tags" and you get loads of examples.

Agreed, check that you may make these edits within the CMS.
 
Back
Top