Gossamer Forum
Home : Products : Links 2.0 : Customization :

Detailed URL like .../name_of_link_here.html

Quote Reply
Detailed URL like .../name_of_link_here.html
Hi All

Instead of building detailed pages that are named:

..../101.html
..../333.html

it would be super if they could use the link title instead:

..../my_favorite_ice_cream.html
..../golden_retriever.html

From what I understand, pages so named are more search-engine friendly.

Anyone know if this is do-able? I'm thinking that a new field could be added and just change the build routine to use whatever you put in that field...maybe the "url_name" field.

Many thanks Smile

------------------------------------------
military dog tags for personal identification, travel, and many other uses
Quote Reply
Re: [DogTags] Detailed URL like .../name_of_link_here.html In reply to
Yep...that is the right approach, DogTags...You'd need to add a new field in the LINKS.DEF and update your LINKS.DB file.

You'd also need to edit the sub build_detailed_pages routine in the NPH-BUILD.CGI.

Then edit the ADD and MODIFY templates to incorporate the new field....

You'd have to add some instructions like "Enter SHORT title" of your link...you'd also have to replace (regexp) spaces with underscores, you could probably use one of the subs in the DB_UTILS.PL file for that...
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Stealth] Detailed URL like .../name_of_link_here.html In reply to
Hey, thanks, Stealth! I very much appreciate the extra details about what needs to be tweaked. Will make job on my end much easier.

Many thanks! Smile

------------------------------------------
military dog tags for personal identification, travel, and many other uses
Quote Reply
Re: [DogTags] Detailed URL like .../name_of_link_here.html In reply to
You would also have to make sure that the filename used is unique if they're all going to be built in the same directory, or you could have problems with files being overwritten.

You might not notice this happen for some time, so it would be best to add some sort of safety check now rather than later.
Quote Reply
Re: [wysardry] Detailed URL like .../name_of_link_here.html In reply to
Good suggestion...I neglected to mention that...and when you do check for that new field (from the end user based forms), make sure that you use LC or UC case sensitive checking to make sure that someone doesn't add dups like the following:

THANK GOD FRIDAY

and

ThaNk God FridAY

Also, you might want to consider reducing the number of words people can input...since some file systems do not allow more than a certain number of characters and plus it's really annoying seeing a URL like the following:

http://mydomain.com/something_something_something_something_zzzz_aaaa_aaaaa_something_something.html

Also, your concerns about search engines are valid, however, many of them do index dynamic web pages quite well.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Stealth] Detailed URL like .../name_of_link_here.html In reply to
Ah, yes....good catch!

I think what I'll do is something like this:

..../$url_name_$id$extension

..../eagles_will_win_superbowl_next_year_100.html
..../eagles_will_win_superbowl_next_year_101.html

Also, might have to tweak sub build_detail_index in nph_build:

Quote:
print DETAIL "$values[$db_key_pos]$db_delim$build_root_url/Detailed/$values[$db_id].html\n";

.../Detailed/$values[$db_url_name]_[$db_id].html

Sound reasonable?

Thanks! Smile

------------------------------------------
military dog tags for personal identification, travel, and many other uses
Quote Reply
Re: [DogTags] Detailed URL like .../name_of_link_here.html In reply to
That would take care of the unique name issue, but not really address the long file name.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Stealth] Detailed URL like .../name_of_link_here.html In reply to
I see. The author of the link would have to remember to make the url_name short:

.../eagles_win_101.html

Good point. Smile

------------------------------------------
military dog tags for personal identification, travel, and many other uses
Quote Reply
Re: [DogTags] Detailed URL like .../name_of_link_here.html In reply to
The author wouldn't have to remember to make url_name short, you could force them to use a short name. The database definition allows you to state the length of the input field and the maximum length allowed for data.

If you aren't concerned about the ID number being in the filename, there are a couple of other alternatives.

1. Build the detailed files inside the category directory instead of inside "Detailed". i.e. /cat/deepcat/deepercat/101.html

2. Use the category name as part of the filename. i.e. Detailed/deepercat_101.html

The first would probably be easiest, and would give the search robots more keywords to latch onto (directory names add "weight" to keywords at most search engines).
Quote Reply
Re: [wysardry] Detailed URL like .../name_of_link_here.html In reply to
This is getting better all the time. Thanks, wysardry Smile

I appreciate everyone's help Smile

------------------------------------------
military dog tags for personal identification, travel, and many other uses

Last edited by:

DogTags: Feb 1, 2003, 3:05 AM
Quote Reply
Re: [DogTags] Detailed URL like .../name_of_link_here.html In reply to
That's funny, I'm working on the same project since quite a while. I proceeded as Eliot suggested. However, I'm linking directly to the detailed pages and haven't succeeded yet in modifying jump.cgi so that hits to the renamed detail pages are counted.
Quote Reply
Re: [Thomas.] Detailed URL like .../name_of_link_here.html In reply to
Does that mean that you aren't linking to external sites and that your detailed pages themseles are the resources?

If so, just put the URL of the detailed page into the URL field, and modify the template to use jump.cgi instead of linking directly.

I think it would just be a matter of commenting out or removing an if block that checks if detailed page building is enabled.

It's not the best solution, as it requires you to enter the URL manually, but it could be used as a quick fix until you work out how to change the code so the program works out the URL for itself.
Quote Reply
Re: [wysardry] Detailed URL like .../name_of_link_here.html In reply to
Thanks wysardry, I was so much focused on modifying jump.cgi, haven't thought about your solution at all. Smile

I'm working on a glossary, so I'm only referencing internal pages.
Quote Reply
Re: [Thomas.] Detailed URL like .../name_of_link_here.html In reply to
Then you don't even need to include the full URL - if you remove the 'http://' part of the database definition for the URL field.

Instead of

http://www.yoursite.com/cat/subcat/page.html

you can use

/cat/subcat/page.html

(note the first slash). This will save a lot of typing, and could be useful if you ever move your site to another domain.