4images Forum & Community
4images Issues / Ausgaben => Discussion & Troubleshooting => Topic started by: khansahib on July 11, 2011, 05:48:35 PM
-
Hello,
I am running 4images on my website, today i checked the Google webmaster section and i have noticed that Google is pointing many pages as duplicate, I am trying to use Google Canonical but i am unable to fix this issue. My website URL structure is as follows.
site.com/stuff/cat-nokia-7710-themes-27.htm
site.com/stuff/cat-nokia-7710-themes-27.htm?page=2
site.com/stuff/cat-nokia-7710-themes-27.htm?page=3
and so on
now I want to add Google Canonical to my first URL i.e. site.com/stuff/cat-nokia-7710-themes-27.htm
How should I do this?
-
......site.com/stuff/cat-nokia-7710-themes-27.htm
site.com/stuff/cat-nokia-7710-themes-27.htm?page=2
site.com/stuff/cat-nokia-7710-themes-27.htm?page=3
.....
copy the follow row in all *?page=X between <head> .....</head>:
<head>
.
.
<link rel="canonical" href="http://www.site.com/stuff/cat-nokia-7710-themes-27.htm"/>
.
</head>
mfg Andi
-
Well, as you know doing manually will take ages as we have categories with 100 pages, so it won't do the trick, is there anything that can be changed i mean something in functions.php?
in my opinion there should be some changes in the following in functions.php
"cat_url" => $site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$image_row['cat_id']),
I am not sure i am right.
need your help.
-
there is no php file?: "cat-nokia-7710-themes-27.php"
-
No we are using modified .htaccess here is what we have in .htaccess
# Begin search engine friendly links code
RewriteEngine On
#RewriteBase /
#Mod_bmollet : category name in URL
RewriteRule ^cat-(.*)-([0-9]+).htm categories.php?cat_id=$2&%{QUERY_STRING}
#Mod_bmollet : Image name in URL
RewriteRule ^theme-(.*)-([0-9]+).htm details.php?image_id=$2&%{QUERY_STRING}
#Mod_bmollet : This is to make search function work ( redirect links from search results )
RewriteRule ^theme([0-9]+).search.htm details.php?image_id=$1&%{QUERY_STRING}
RewriteRule ^cat\.htm$ categories.php?%{QUERY_STRING}
RewriteRule ^postcard([a-zA-Z0-9]+)\.htm$ postcards.php?postcard_id=$1&%{QUERY_STRING}
RewriteRule ^postcard\.img([0-9]+)\.htm$ postcards.php?image_id=$1&%{QUERY_STRING}
-
I can not help you....
-
can anybody please help me on this? Its v.imp
-
is there any solution available?
-
......site.com/stuff/cat-nokia-7710-themes-27.htm
site.com/stuff/cat-nokia-7710-themes-27.htm?page=2
site.com/stuff/cat-nokia-7710-themes-27.htm?page=3
I hope the above urls with page=2 and page=3 might be from comment pagination?
-
......site.com/stuff/cat-nokia-7710-themes-27.htm
site.com/stuff/cat-nokia-7710-themes-27.htm?page=2
site.com/stuff/cat-nokia-7710-themes-27.htm?page=3
I hope the above urls with page=2 and page=3 might be from comment pagination?
can you please further explain your reply? I am unable to understand/.
-
site.com/stuff/cat-nokia-7710-themes-27.htm?page=2
site.com/stuff/cat-nokia-7710-themes-27.htm?page=3
I mean how this pages are coming to you .It might come if you click the pagination in the comment system?
by clicking the next page in the comment?
-
I have done it :) 8)
-
I have done it :) 8)
can you pls. let us know your solution and what you have changed in which files? thx!
-
Here is how its done :).
open index.php file and find
include(ROOT_PATH.'includes/page_header.php');
Paste the following just before the above line.
if(isset($_GET['page'])) {
$site_template->register_vars("google_con_url", '<link rel="canonical" href="' . ROOT_PATH . '/' . $_SERVER['REQUEST_URI'] . '" />');
}
else {
$site_template->register_vars("google_con_url", '');
}
and insert
{google_con_url}
in header of your template. Make sure its between <head> tags.
-
Hi - thanx
I assume that the code is inserted in the file details.php - right?
-
ah sorry i didn't mentioned that its in index.php
-
ah sorry i didn't mentioned that its in index.php
ahhh ok, thanks!!
-
does not work with 4image install...
did anybody get this mod to work?
-
Hi ,
Check out this , it is working Mod
http://www.4homepages.de/forum/index.php?topic=17598.420
Best Regards,
Satz
-
it doesn't really work! Why? Is the code too old?
Here is how its done :).
open index.php file and find
include(ROOT_PATH.'includes/page_header.php');
Paste the following just before the above line.
if(isset($_GET['page'])) {
$site_template->register_vars("google_con_url", '<link rel="canonical" href="' . ROOT_PATH . '/' . $_SERVER['REQUEST_URI'] . '" />');
}
else {
$site_template->register_vars("google_con_url", '');
}
and insert
{google_con_url}
in header of your template. Make sure its between <head> tags.