Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Remove index.html to show "domain/cat/" in Gossamer Links 3.0.1

Quote Reply
Remove index.html to show "domain/cat/" in Gossamer Links 3.0.1
Hi, this question has been discussed before at http://www.gossamer-threads.com/...orum.cgi?post=229800. I tried the method they mentioned, Unfortunately it doesn't work for me in Gossamer Links 3.0.1.

Many people think it's not necessary to change file path "domain.com/category/index.html " to "domain.com/category/". I'd think it's very important to show domain.com/category/ instead of domain.com/category/index.html, because:
  1. Internal and external links to domain.com/category/ is desirable considering the fact some people need to shift between index.html, index.shtml, index.php, or even index.asp when doing an upgrade on their websites. Whatever they change, the link path domain.com/category/ remains unchanged. This path still keeps the PR Google assigned to it, inbound links are still useful to guide either visitors or search engines to visit or crawl the site. While with an index.html, index.shtml, or index.php, an change in file name makes it lose original PR, link value, and make visitor' bookmark useless.
  2. domain.com/category/ looks cleaner, people are used to the ways DMOZ, Yahoo! directories show their directory paths. So why not Gossamer Links?

Could anyone please give me a solution? Thanks very much!
Quote Reply
Re: [wang] Remove index.html to show "domain/cat/" in Gossamer Links 3.0.1 In reply to
Frown mmm... nobody can help me?
Quote Reply
Re: [wang] Remove index.html to show "domain/cat/" in Gossamer Links 3.0.1 In reply to
This could be a very good feature to have.

Also if possible, I would love to go one step forward and ask for www.domain.com/category/, www.domain.com/category/sub-category/ & www.domain.com/detailed-path/link-title/ type option too.

I do think the /link-title/ type option might create tons of category, but it would solve the problem of .html,shtml,php.. etc for good and no matter what extension admin wishes to use, it will never hurt in search engine.

Vishal
-------------------------------------------------------
Quote Reply
Re: [wang] Remove index.html to show "domain/cat/" in Gossamer Links 3.0.1 In reply to
This is something we'll be considering for a future release. There may be certain situations which might prevent us from adding this, so I can't guarantee that it will be added.

Adrian

Last edited by:

brewt: May 24, 2005, 3:16 PM
Quote Reply
Re: [brewt] Remove index.html to show "domain/cat/" in Gossamer Links 3.0.1 In reply to
In Reply To:
This is something we'll be considering for a for the next release. There may be certain situations which might prevent us from adding this, so I can't guarantee that it will be added.

Awasome :) will be eagerly waiting for the next relase.

Vishal

Vishal
-------------------------------------------------------
Quote Reply
Re: [wang] Remove index.html to show "domain/cat/" in Gossamer Links 3.0.1 In reply to
There is a discussion at WMW on changing index page extension, you may be interested.
http://www.webmasterworld.com/forum30/29533.htm
Quote Reply
Re: [wang] Remove index.html to show "domain/cat/" in Gossamer Links 3.0.1 In reply to
What about rewriting the url?

^/pages/index.html$ /pages/ [R,L]

That should have the same effect as serving up index.html on the domain root.

That would work for the first pages of categories,

something like:

^/pages/(.*)/index.html$ /pages/$1/ [R,L]

Just a thought.


PUGDOG´┐Ż Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [brewt] Remove index.html to show "domain/cat/" in Gossamer Links 3.0.1 In reply to
Any ideas if there are still plans to add this to a future release?
Quote Reply
Re: [garrynz] Remove index.html to show "domain/cat/" in Gossamer Links 3.0.1 In reply to
Ok, I am trying to do this with a global and so far have managed to get it done with the category links. I am using yahoo subcats.

remove_category_index

sub {
my $tags = GT::Template->tags;
my $url = $tags->{URL};
$url =~ s/index.html//;
return $url;
}


replace <%URL%> with <%remove_build_index%> in subcategory.html

and

remove_description_index

sub {
my $tags = GT::Template->tags;
my $description = $tags->{Description};
$description =~ s/index.html//g;
return $description;
}

replace <%Description%> with <%remove_description_index%>

Now I am having a bit of trouble with the breadcrumb, any ideas?

Last edited by:

garrynz: Jul 11, 2005, 11:46 AM
Quote Reply
Re: [garrynz] Remove index.html to show "domain/cat/" in Gossamer Links 3.0.1 In reply to
Couldn't figure out a global, but adding

$ret =~ s/index.html//g;

below

$ret .= qq|<a href="$title_loop->[$_]->{URL}">$title_loop->[$_]->{Name}</a>|;

in Utils.pm seem to do the trick.
Quote Reply
Re: [garrynz] Remove index.html to show "domain/cat/" in Gossamer Links 3.0.1 In reply to
Does anyone have this working? I need to remove index.html from categories and tried the above.. The breadcrumb works, however the category links change using globals returns an error of 'Variable is not scalar' for each link. Any other ways of doing this?
Quote Reply
Re: [NetTrace] Remove index.html to show "domain/cat/" in Gossamer Links 3.0.1 In reply to
Got it sorted.. needed to replace all of <%escape_html URL%> rather than just the URL part of it..
Quote Reply
Re: [NetTrace] Remove index.html to show "domain/cat/" in Gossamer Links 3.0.1 In reply to
cool, there is a mistake in the above,

replace <%URL%> with <%remove_build_index%> in subcategory.html

should obviously have been

replace <%URL%> with <%remove_category_index%> in subcategory.html
Quote Reply
Re: [garrynz] Remove index.html to show "domain/cat/" in Gossamer Links 3.0.1 In reply to
It would be very helpful if the ability to remove the index was added to future releases of Glinks without needing to change the code of pm files.

As a simple suggestion perhaps by adding a

show_index => 0, # 1 = yes 0 = no

option to paging, breadcrumb, URL and detailed.


If anyone is changing the c
ode of pm files you may want to update the paging sub too depending on which style your using by adding

$ret =~ s/$CFG->{build_index}//g;

above both

return $ret;

in Utils.pm



Cheers,

Charlie



Comedy Quotes - Glinks 3.3.0, PageBuilder, StaticURLtr, CAPTCHA, User_Edit_Profile

Quote Reply
Re: [garrynz] Remove index.html to show "domain/cat/" in Gossamer Links 3.0.1 In reply to
Hi,

Did this acually worlk OK? I tried this hack in Utils.PM but still index.html for the categories is returned.

Quote:
$ret =~ s/index.html//g;

below

$ret .= qq|<a href="$title_loop->[$_]->{URL}">$title_loop->[$_]->{Name}</a>|;

in Utils.pm seem to do the trick.

~ ERASER


Free JavaScripts @ Insight Eye

Last edited by:

Eraser: May 19, 2006, 3:11 AM
Quote Reply
Re: [Eraser] Remove index.html to show "domain/cat/" in Gossamer Links 3.0.1 In reply to
That just removes the index.html in the breadcrumb

Add a global called remove_category_index

sub {
my $tags = GT::Template->tags;
my $url = $tags->{URL};
$url =~ s/index.html//g;
return $url;
}

And <dt><a href="<%remove_category_index%>"><%if RelationName%><%RelationName%> .... in subcategory.html

and if using Yahoo subcats which I am make a global called remove_description_index

sub {
my $tags = GT::Template->tags;
my $description = $tags->{Description};
$description =~ s/index.html//g;
return $description;
}

and in subcategory.html

<%if Description%><dd><%remove_description_index%></dd>
Quote Reply
Re: [garrynz] Remove index.html to show "domain/cat/" in Gossamer Links 3.0.1 In reply to
Many thanks -- and lets hope GT can implement this as an option!

~ ERASER


Free JavaScripts @ Insight Eye
Quote Reply
Re: [Eraser] Remove index.html to show "domain/cat/" in Gossamer Links 3.0.1 In reply to
It took a while, but the next version of GLinks will include support for not appending the build_index (eg. index.html) to the URLs. I have also updated the YahooSubcats plugin to support this as well.

Adrian
Quote Reply
Re: [brewt] Remove index.html to show "domain/cat/" in Gossamer Links 3.0.1 In reply to
Great work Adrian Cool

~ ERASER


Free JavaScripts @ Insight Eye
Quote Reply
Re: [Eraser] Remove index.html to show "domain/cat/" in Gossamer Links 3.0.1 In reply to
Depending on your paging option, you may want to make an additional change. If you have

Pages: [First] [Prev] 1 2 3 4 5 6 [Next] [Last]

you will want to make one more change to the Utils.pm file at line 308. Find

$ret .= qq|">$disp</a>|;
return $ret;

and add

$ret =~ s/index.html//g;

so it looks like this

$ret .= qq|">$disp</a>|;
$ret =~ s/index.html//g;
return $ret;

this seemed to solve the problem. Hope it helps.
Quote Reply
Re: [canuck] Remove index.html to show "domain/cat/" in Gossamer Links 3.0.1 In reply to
you probably actually want:
Code:
s/\Q$CFG->{build_extension}\E//g;

Philip
------------------
Limecat is not pleased.
Quote Reply
Re: [fuzzy logic] Remove index.html to show "domain/cat/" in Gossamer Links 3.0.1 In reply to
Thanks a lot, I like the idea, but how do you create a 301 direct for all the pages ending in index.html that have already been indexed by search engines?
Quote Reply
Re: [Dorette] Remove index.html to show "domain/cat/" in Gossamer Links 3.0.1 In reply to
Hi,

I think you would need something like:

Code:
RewriteRule ^(.*)/index.html$ http://www.domain.com/$1/ [R=301]

Untested, but should work.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!