Author Topic: The solution for Short (SEO Friendly) URL's  (Read 113661 times)

Offline Ruud

  • Posts: 3669
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
The solution for Short (SEO Friendly) URL's
« on: March 26, 2010, 05:30:36 PM »
Despite WebsiteBaker produces url's that are believed to be SEO friendly, a lot of people ask for even more friendly URL's.

I created a set of stand alone files (Not a module/snippet) that will enable url's in WebsiteBaker like www.mysite.tld/about_us instead of www.mysite.tld/pages/about_us.php.

The are 3 parts involved:

1. a .htaccess that detects any parameter not being a directory or file and forward that parameter to a script.
2. a script that will do a lookup for the parameter and find the correct page.
3. a Droplet that will transform any internal link on a page to the "short" form.

More explanation and a download can be found on http://short.dev4me.nl/howto/

Please note this approach might not work for every website! Please test before using it in production websites!!

Please let the community know if this works for you.

Download: http://short.dev4me.nl/download/


Ruud
(edit: corrected links)
« Last Edit: June 10, 2015, 10:54:18 PM by Ruud »

Offline Hans>NULL

  • Posts: 1386
  • Gender: Male
Re: The solution for Short (SEO Friendly) URL's
« Reply #1 on: March 26, 2010, 06:13:34 PM »
/dev/null Ort ohne Wiederkehr

snark

  • Guest
Re: The solution for Short (SEO Friendly) URL's
« Reply #2 on: April 18, 2010, 11:52:48 AM »
is there a simple way to maintain the levelstructure so that the problem with pages with the same menutitle will not occur..

so that  www.website.com/pages/seofriendlyurl.php

will be

www.website.com/seofriendlyurl

and

so that  www.website.com/pages/subpage/seofriendlyurl.php

will be

www.website.com/subpage/seofriendlyurl




Offline Ruud

  • Posts: 3669
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: The solution for Short (SEO Friendly) URL's
« Reply #3 on: April 18, 2010, 11:10:46 PM »
Sorry no, not in the way this "hack" is made.

You could try the other solution that Hans>NUL suggested.

Offline PurpleEdge

  • Posts: 231
  • Gender: Male
    • the northern beaches
Re: The solution for Short (SEO Friendly) URL's
« Reply #4 on: April 19, 2010, 02:29:52 PM »
« Last Edit: October 24, 2019, 04:21:28 PM by Luisehahne »

Offline SickBoy75

  • Posts: 16
Re: The solution for Short (SEO Friendly) URL's
« Reply #5 on: May 20, 2010, 12:23:58 PM »
I don't really understand the problem...

I also didn't like the www.myweb/pages/home.php, so i remove the /pages in the WB config.... and thats all!!!

and i don't have any problem with menus or any other thing.

I also changed the /bakery (which is a default) to make it more SEO, and post the mod on this forum

Offline Ruud

  • Posts: 3669
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: The solution for Short (SEO Friendly) URL's
« Reply #6 on: May 20, 2010, 01:51:12 PM »
If you (or a webmaster) ever creates a page called admin or media (or any other WB directory) you will be in trouble.
The /pages (or whatever you name it) is there for a reason.

chio

  • Guest
Re: The solution for Short (SEO Friendly) URL's
« Reply #7 on: May 20, 2010, 05:15:05 PM »
Does someone here REALLY think, Google cares about the str_length of URLs?

Non SEF-URLs look like /index.php?bl=12784534&blu=12342kXX&ble=9duz34jsdf&sup=sdf8sdjsdf345()

WB generates PERFECT SEF-URLs. The only issue is that URLs depend on Menu-Titles.

Offline SickBoy75

  • Posts: 16
Re: The solution for Short (SEO Friendly) URL's
« Reply #8 on: May 20, 2010, 07:05:36 PM »
If you (or a webmaster) ever creates a page called admin or media (or any other WB directory) you will be in trouble.
The /pages (or whatever you name it) is there for a reason.


good to know, i'm the only one admin this web, so no problem.

The trouble is that the WB direectory will be deleted, isn't it??

For new instalations i will use a SEO word instead of /pages, for me it's enough

Offline snaak

  • Posts: 8
Re: The solution for Short (SEO Friendly) URL's
« Reply #9 on: December 13, 2010, 08:25:38 PM »
question: there is a problem when submitting form. In the help section this is mentioned only no solution is given. Any idea how to fix this?

Offline Ruud

  • Posts: 3669
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: The solution for Short (SEO Friendly) URL's
« Reply #10 on: December 13, 2010, 10:14:13 PM »
question: there is a problem when submitting form. In the help section this is mentioned only no solution is given. Any idea how to fix this?
I have several sites with forms that work ok, what is your problem?

Offline snaak

  • Posts: 8
Re: The solution for Short (SEO Friendly) URL's
« Reply #11 on: December 15, 2010, 05:06:51 PM »
hi,
When I push the submit button I got redirected to http://www.domain.com/pages/?_page=pages.
Is this an error in the .htaccess file? Or do you know a workaround.

Offline Ruud

  • Posts: 3669
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: The solution for Short (SEO Friendly) URL's
« Reply #12 on: December 15, 2010, 05:11:56 PM »
What form are you using? I guess it's not the standard WB form..

Anyway, without looking at the form and/or action url I cannot say why this is happening.

Offline Ruud

  • Posts: 3669
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: The solution for Short (SEO Friendly) URL's
« Reply #13 on: November 16, 2011, 04:16:32 PM »
A new version (v2.0) is made available for download today.
http://short.allwww.nl/

The links will be rewritten diferently from the first version.
A page like
  http://www.mydomain.com/pages/products/myproduct.php
is now rewritten as
  http://www.mydomain.com/products/myproduct/

The nice extra is, also news posts will be used in this format form now on.

Downloadlink: http://short.allwww.nl/download/

Offline Stefek

  • Posts: 6177
  • Gender: Male
  • ("ړ)
Re: The solution for Short (SEO Friendly) URL's
« Reply #14 on: November 16, 2011, 06:31:28 PM »
Thank you Ruud.

Do I need a new version of WB and News Module to use it?

Regards,
Stefek
"Gemeinsam schafft man mehr."

gemeinsam
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

Offline Ruud

  • Posts: 3669
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: The solution for Short (SEO Friendly) URL's
« Reply #15 on: November 16, 2011, 07:07:07 PM »
Nope, this will work in any WB (2.7 and up)

Offline Stefek

  • Posts: 6177
  • Gender: Male
  • ("ړ)
Re: The solution for Short (SEO Friendly) URL's
« Reply #16 on: November 16, 2011, 10:41:34 PM »
Thank you!
"Gemeinsam schafft man mehr."

gemeinsam
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

Offline Bug

  • Posts: 237
Re: The solution for Short (SEO Friendly) URL's
« Reply #17 on: November 16, 2011, 10:55:36 PM »
Would it be easy to also get rid of the trailing slash?

Offline Ruud

  • Posts: 3669
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: The solution for Short (SEO Friendly) URL's
« Reply #18 on: November 16, 2011, 11:07:34 PM »
Sure, it was added "on purpose" to simulate WP type of links :-)
It is added in the droplet code. Just remove it and it will work without.

Code: (droplet) [Select]
    $wb_page_data = str_replace($linkstart.$link.$linkend, $newvalue.'/', $wb_page_data);into
Code: [Select]
    $wb_page_data = str_replace($linkstart.$link.$linkend, $newvalue, $wb_page_data);

Offline PurpleEdge

  • Posts: 231
  • Gender: Male
    • the northern beaches
Re: The solution for Short (SEO Friendly) URL's
« Reply #19 on: November 16, 2011, 11:27:46 PM »
Websites work faster WITH the trailing URL.

Offline Bug

  • Posts: 237
Re: The solution for Short (SEO Friendly) URL's
« Reply #20 on: November 17, 2011, 07:47:48 AM »
Websites work faster WITH the trailing URL.

Any documentation on that matter?

Offline PurpleEdge

  • Posts: 231
  • Gender: Male
    • the northern beaches
Re: The solution for Short (SEO Friendly) URL's
« Reply #21 on: November 17, 2011, 08:08:09 AM »
Do a search for "URL trailing slash"

You get a redirect without one, to add the trailing slash.

No idea what effect Ruud's mod has though?

Offline Ruud

  • Posts: 3669
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: The solution for Short (SEO Friendly) URL's
« Reply #22 on: November 17, 2011, 10:01:26 AM »
You get a redirect without one, to add the trailing slash.
That wil only happen when the server needs to send out a default document (i.e. index.php)
In this case all calls are rerouted to a single script. So no differences in redirect with or without the trailing slash.

This url rewrite is purely cosmetic. It has no advantage on indexing by searchengines.
The standard WebsiteBaker way of serving pages is just as good.
It just is meant to create nicer readable url's.

Offline dbs

  • Betatester
  • **
  • Posts: 8829
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: The solution for Short (SEO Friendly) URL's
« Reply #23 on: November 18, 2011, 05:38:37 PM »
hi, i have a problem with standard form in wb2.8.2 Rev1518.
after click submit-button the site will redirected to start-page.
what could be the problem?

dbs

Offline Ruud

  • Posts: 3669
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: The solution for Short (SEO Friendly) URL's
« Reply #24 on: November 18, 2011, 11:10:43 PM »
Can you share the link where this is happening? (PM if you do not want to make it public)