Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Re: [Andy] Category Home URL and Canonicalization

Quote Reply
Re: [Andy] Category Home URL and Canonicalization In reply to
Andy wrote:
You wanna remove the index.html from all the URLs?

Give this a go:

strip_indexhtml
Code:
sub {
my $tmp = $_[0];
$tmp =~ s/index\.html//sig;
return $tmp;
}


Then call in subcategory.html (for example), with:

Code:
<%strip_indexhtml($URL)%%>


Cheers

The code above works fine. But I just changed it for a few seconds, cause links with urls like
http://www.mydomain.com/categeory/index.html
are still working, too.
I think google would now spider a lot of duplicate urls :-(


PS: The code above did not work on my home.html in this part. It should work, cause subcategory.html is called.
Any suggestions why it does not work???
Code:
<%set split = Links::Utils::column_split($category_loop.length, $home_category_cols)~%>
<div class="clear">
<%loop category_loop%>
<%~set splitmod = $row_num % $split%>
<%~if row_num == 1 or splitmod == 1 or split == 1%><dl><%endif%>
<%~include subcategory.html%>
<%~if row_num == $category_loop.length or splitmod == 0%></dl><%endif%>
<%~endloop%>
</div>

Matthias
gpaed.de
Subject Author Views Date
Thread Category Home URL and Canonicalization colintho 13577 Dec 15, 2009, 12:55 AM
Thread Re: [colintho] Category Home URL and Canonicalization
Andy 13301 Dec 15, 2009, 1:16 AM
Thread Re: [Andy] Category Home URL and Canonicalization
colintho 13261 Dec 15, 2009, 2:50 AM
Thread Re: [colintho] Category Home URL and Canonicalization
Andy 13279 Dec 15, 2009, 2:53 AM
Thread Re: [Andy] Category Home URL and Canonicalization
colintho 13155 Dec 15, 2009, 3:17 AM
Post Re: [colintho] Category Home URL and Canonicalization
Andy 13197 Dec 15, 2009, 3:28 AM
Thread Re: [colintho] Category Home URL and Canonicalization
Matthias70 13178 Dec 15, 2009, 9:51 AM
Thread Re: [Matthias70] Category Home URL and Canonicalization
Andy 13246 Dec 15, 2009, 10:22 AM
Thread Re: [Andy] Category Home URL and Canonicalization
Matthias70 13182 Dec 15, 2009, 10:29 AM
Thread Re: [Matthias70] Category Home URL and Canonicalization
Andy 13233 Dec 15, 2009, 10:31 AM
Thread Re: [Andy] Category Home URL and Canonicalization
Matthias70 13183 Dec 15, 2009, 10:39 AM
Post Re: [Matthias70] Category Home URL and Canonicalization
Andy 13220 Dec 15, 2009, 11:00 AM
Thread Re: [Andy] Category Home URL and Canonicalization
Matthias70 13168 Dec 15, 2009, 11:49 AM
Post Re: [Matthias70] Category Home URL and Canonicalization
Andy 13230 Dec 15, 2009, 12:03 PM
Thread Re: [colintho] Category Home URL and Canonicalization
brewt 13162 Dec 15, 2009, 12:12 PM
Thread Re: [brewt] Category Home URL and Canonicalization
Matthias70 13134 Dec 15, 2009, 12:22 PM
Thread Re: [Matthias70] Category Home URL and Canonicalization
brewt 13188 Dec 15, 2009, 12:31 PM
Post Re: [brewt] Category Home URL and Canonicalization
Matthias70 13131 Dec 15, 2009, 12:38 PM