Question

I've a page that shows the last 10 articles of a database, and, with the $_GET['show-all'] variable, it shows all the articles.

Now, I want to use permalink. For the 'standard' page, the permalink is

/articles

for the second one, I might use this

/articles/show-all

But search engines as Google recognizes it as another page, and generated a duplicated meta-tag error. So I want to use this permalink instead

/articles/?show-all

But all my attempts didn't work. I tried this code in the .htaccess file:

RewriteRule ^articles/?(.*)$ /3/contents.php?p=articles&$1 [L]

or

RewriteRule ^articles/\?(.*)$ /3/contents.php?p=articles&$1 [L]    
Was it helpful?

Solution

Take a look at the canonical tag

http://en.wikipedia.org/wiki/Canonical_link_element

to avoid "duplicate content" ;)

OTHER TIPS

Try to always use a trailing slash or not.

Since /name != /name/

Therefore go for /name?param in your case.

this topic has a lot of information about it by the way: When should I use a trailing slash in my URL?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top