PDA

View Full Version : modrewrite and duplicate content


guiz
04-30-2007, 07:45 PM
I'm using this lines in my .htaccess file

RewriteEngine On

RewriteRule ^(browse|link|about)$ index.php?x=$1&pagenum=1
RewriteRule ^browse/([0-9]+)$ index.php?x=browse&category=&pagenum=$1
RewriteRule ^browse/category/([0-9]+)/([0-9]+)$ index.php?x=browse&category=$1&pagenum=$2
RewriteRule ^browse/category/([0-9]+)$ index.php?x=browse&category=$1&pagenum=1
RewriteRule ^comment/([0-9]+)$ index.php?popup=comment&showimage=$1
RewriteRule ^comment/submit$ index.php?x=save_comment
RewriteRule ^photo/([0-9]+)$ index.php?showimage=$1
RewriteRule ^photo/([0-9]+)/rating/([1-5])$ index.php?showimage=$1&rating=$2
RewriteRule ^photo/file/(.+)$ /images/$1
RewriteRule ^thumbnails/latest$ index.php?showthumb=latest&thumbtag=image
RewriteRule ^feeds/(rss|atom).xml$ index.php?x=$1
RewriteRule ^browse/archive/(.*)/([0-9]+)$ index.php?x=browse&archivedate=$1&pagenum=$2
RewriteRule ^browse/archive/(.*)$ index.php?x=browse&archivedate=$1&pagenum=1

in index.php
instead:
$showprefix = "";

I have
$showprefix = "photo/";

in image_template:
instead:
<a href="index.php?showimage=<IMAGE_PREVIOUS_ID>">

I have
<a href="/photo/<IMAGE_PREVIOUS_ID>">

in /includes/pixelpost.php I have added:
$mod_rewrite = "1";

When I navigate in image_template.html the files are displayed as:
http://www.domain.com/photo/163

but when I go to the gallery (browse_template.html) the links are as
http://www.domain.com/index.php?showimage=163

and
http://www.domain.com/index.php?x=browse&category=4

and so I have the problem with "duplicate content" with goolge, because I have 2 pages with the same content.

can you tell me what is wrong in the .htaccess file?

Joe[y]
05-01-2007, 01:36 PM
basically the rewrite allows you to mask the untidy urls with the clean ones you define in your .htaccess file. so to use the clean urls you need to make sure that all links in your index.php file and any addons etc match with what you wanted when you wrote the .htaccess

in short you haven't changed how the links for thumbnails and categories are produced for tags in your index.php file. if you have trouble doing this or understanding what i mean then see how it works here: http://photos.jlspurling.com/browse

plus google will probably keep the old links in it's system for a while but once they are linked no more they'll drop down a long way in the google rankings so don't worry about that.

guiz
05-01-2007, 05:25 PM
I am not using addons for the browse page
can you tell me in what lines I must change the index.php file?

in the line #597 I have:
$image_category_all .= "<a href='$PHP_SELF?x=browse&amp;category=$cat_id'>" .$cfgrow['catgluestart'] .$name .$cfgrow['catglueend']."</a> &nbsp;";
$image_category_all_paged .= "<a href='$PHP_SELF?x=browse&amp;category=$cat_id&amp;pagenum= 1'>" .$cfgrow['catgluestart'] .$name .$cfgrow['catglueend']."</a> &nbsp;";

how must I change it?

I have seen your browse page, that is what I want.

and you are right: I have many pages in the google secondary index. but I also have many pages in the normal index of google.