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

Offline dbs

  • Betatester
  • **
  • Posts: 8076
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: The solution for Short (SEO Friendly) URL's
« Reply #75 on: September 27, 2012, 11:09:27 PM »
Hi, in the frontend all works fine with v2.3.
Have tested with WB 2.8.1 and 2.8.3.

But if i call a page from the backend (pages overview or page-settings) i have a 404 (accept start-page).
It is a installation in a subfolder. This subfolder will correctly displayed in the link-target (mouseover) in the backend, but not in the url of the called page.
Can somebody confirm this (if somebody understand me)?
« Last Edit: September 28, 2012, 08:15:21 AM by dbs »

jacobi22

  • Guest
Re: The solution for Short (SEO Friendly) URL's
« Reply #76 on: September 28, 2012, 01:30:58 AM »
Try this -> http://www.websitebaker2.org/forum/index.php/topic,22371.0.html  :wink:
(works not with the Rev's > 1532)
« Last Edit: September 28, 2012, 02:01:47 AM by jacobi22 »

Offline dbs

  • Betatester
  • **
  • Posts: 8076
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: The solution for Short (SEO Friendly) URL's
« Reply #77 on: September 28, 2012, 08:20:54 AM »
Quote
(works not with the Rev's > 1532)
thanks, you mean really greater than 1532?
We will have in short time the WB 2.8.4, with Rev greater than 1775.
The solution from Stefek can't be the right way for using "short url".

Offline Ruud

  • Posts: 3649
  • 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 #78 on: September 28, 2012, 10:19:23 AM »
It is a installation in a subfolder. This subfolder will correctly displayed in the link-target (mouseover) in the backend, but not in the url of the called page.

Can you show your .htaccess file?

Offline dbs

  • Betatester
  • **
  • Posts: 8076
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: The solution for Short (SEO Friendly) URL's
« Reply #79 on: September 28, 2012, 10:23:21 AM »
should be the original-code. nothing else in htaccess.
Code: [Select]
RewriteEngine On
# If called directly - redirect to short url version
RewriteCond %{REQUEST_URI} pages
RewriteRule ^pages/(.*).php$ /$1/ [R=301,L]

# Send the request to the short.php for processing
RewriteCond %{REQUEST_URI} !^/(pages|admin|framework|cgi-bin|include|languages|media|account|search|temp|templates/.*)$
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([\/\sa-zA-Z0-9._-]+)$ short.php?_page=$1 [QSA]

Offline Ruud

  • Posts: 3649
  • 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 #80 on: September 28, 2012, 02:39:38 PM »
The problem must be found in this part

Code: [Select]
# If called directly - redirect to short url version
RewriteCond %{REQUEST_URI} pages
RewriteRule ^pages/(.*).php$ /$1/ [R=301,L]

Try something like (assuming you installed in a /wb/ directory)

Code: [Select]
# If called directly - redirect to short url version
RewriteCond %{REQUEST_URI} wb/pages
RewriteRule ^wb/pages/(.*).php$ /wb/$1/ [R=301,L]

Offline dbs

  • Betatester
  • **
  • Posts: 8076
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: The solution for Short (SEO Friendly) URL's
« Reply #81 on: September 28, 2012, 02:49:25 PM »
Thx Ruud, the 404 is solved.
Also the droplet lastmodifiedpages shows now usable links.  :wink:

Offline Ralleman

  • Posts: 9
Re: The solution for Short (SEO Friendly) URL's
« Reply #82 on: October 17, 2012, 04:43:31 PM »
Hi Ruud,

what should I change in shorturl V2.3 if I just want to remove the directory (/pages).

So e.g. www.domain.com/pages/file.php
to www.domain.com/file.php

Which changes are needed in htaccess, short.php and dropletcode?

Thanks

Offline Ruud

  • Posts: 3649
  • 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 #83 on: October 17, 2012, 05:13:43 PM »
Try this.. (it was one of my first tries)

Remove the /pages/ only use this for droplet code:

Code: (droplet: nopages) [Select]
$wb_page_data = str_replace(WB_URL.PAGES_DIRECTORY, WB_URL, $wb_page_data);
return true;

and this for .htaccess
Code: (.htaccess) [Select]
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !^/pages/
RewriteRule ^(.*)$ /pages/$1 [QSA,L]

the short.php script is not needed anymore for this solution.

Offline Ralleman

  • Posts: 9
Re: The solution for Short (SEO Friendly) URL's
« Reply #84 on: October 18, 2012, 02:53:26 AM »
Hi,
thanks for the reply but unfortunately it does not work.  :-(

I changed the 2 lines in the Dropletcode and that works.

But in htaccess the RewriteRule only link to the original pages directory and the complete URL is shown in the browser.
Is there another way. I do not need the short.php for the new (shorter) URL in the browser?

best regards

Offline Ruud

  • Posts: 3649
  • 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 #85 on: October 18, 2012, 10:08:52 AM »
short.php is not needed for this solution.

Do you have any other lines in your .htaccess?
The RewriteRule should not redirect (show the new url in the browser) but just process the rewritten url.


Offline Ralleman

  • Posts: 9
Re: The solution for Short (SEO Friendly) URL's
« Reply #86 on: October 18, 2012, 02:23:30 PM »
Hi Ruud,

I had made the modification of unawave2 for my own url and it works, but I think this have no effect.
See here: http://www.websitebaker2.org/forum/index.php/topic,10661.25.html

I only have that 5 lines in my htaccess that you have wrote.

I tested it again and now I have noticed something unusual and not noticed before:
Only the subdirectories do not work correctly!
In wb i have made an internal 302 redirect for these directories to show in the menu.
Although I do not recognize the problem, because all links in showMenu2 are correctly!

See website: http://test.art-finish.de/    (dropletcode only set in German)

Can you still add a line for me to htaccess to avoid duplicate content. I mean a redirect 301 to only show the URL without /pages directory?

Thank you for your help!
« Last Edit: October 18, 2012, 02:32:02 PM by Ralleman »

Offline Ruud

  • Posts: 3649
  • 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 #87 on: October 18, 2012, 03:30:44 PM »
The problem is that on language changes or menu-link pages WB will do an internal 301 redirect to the full url.

This might do the trick:

Code: [Select]
RewriteEngine On
RewriteCond %{ENV:REDIRECT_STATUS} !200
RewriteCond %{REQUEST_URI} pages/
RewriteRule ^pages/(.*)$ /$1 [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !^/pages/
RewriteRule ^(.*)$ /pages/$1 [QSA,L]


Offline Ralleman

  • Posts: 9
Re: The solution for Short (SEO Friendly) URL's
« Reply #88 on: October 18, 2012, 05:04:32 PM »
Hi Ruud,

yes you did it!  :-) Thank You!

I think additionally with your great ShortUrl, this is a second good way for short Url without showing the pages directory in frontend.
I have not tested with news modules but i think it will work.


Thank You!

Offline Meint

  • Posts: 218
  • Gender: Male
    • website laten maken voor mkb'ers
Re: The solution for Short (SEO Friendly) URL's
« Reply #89 on: December 13, 2012, 09:56:57 PM »
Hi Ruud,

I am experimenting with your solution for shorter URLS. After installing it works fine.

However, I do have one question: When I look at the google_sitemap.php file, it still contains the URL's with 'pages' in the URL's. Do you know how to change that so Google has the sitemap with the rewritten URL's?


Offline dbs

  • Betatester
  • **
  • Posts: 8076
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: The solution for Short (SEO Friendly) URL's
« Reply #90 on: December 13, 2012, 10:00:36 PM »

Offline Meint

  • Posts: 218
  • Gender: Male
    • website laten maken voor mkb'ers
Re: The solution for Short (SEO Friendly) URL's
« Reply #91 on: December 13, 2012, 10:20:07 PM »
Hi dbs,

Thanks for pointing it out to me!  :-)

Offline Meint

  • Posts: 218
  • Gender: Male
    • website laten maken voor mkb'ers
Re: The solution for Short (SEO Friendly) URL's
« Reply #92 on: December 19, 2012, 06:18:31 PM »
Hi,

I am using topics in combination with the short url solution. However, when I click the "Read more" button I end up at the homepage. The site I am using is a multi language website but I also tested it on a single language website and the same happens there.

I am using the basic .htaccess from short url V2.3

I set up a test website to show you what happens. See http://test.wvmkb-server.nl

Offline Ruud

  • Posts: 3649
  • 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 #93 on: December 19, 2012, 10:35:28 PM »
Short url does not know about the topics module, so shortlinks to those pages are not found by the php script.
To make it work, remove the block from the .htaccess where normal links are rewritten to short links.

Code: (remove this part) [Select]
# If called directly - redirect to short url version
RewriteCond %{REQUEST_URI} pages
RewriteRule ^pages/(.*).php$ /$1/ [R=301,L]

Offline Meint

  • Posts: 218
  • Gender: Male
    • website laten maken voor mkb'ers
Re: The solution for Short (SEO Friendly) URL's
« Reply #94 on: December 19, 2012, 10:50:22 PM »
Hi Ruud,

Thanks. I removed the block and the topis are accessible via the "Read more" link.

So if I understand it correctly Topics can only work with 'pages' in the URL? Or are there other solutions?

Offline Ruud

  • Posts: 3649
  • 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 #95 on: December 19, 2012, 10:53:13 PM »
If I remember correctly, topics had some options in the config files to set a different root path for the posts.
Losing the .php will be more difficult.

Offline Meint

  • Posts: 218
  • Gender: Male
    • website laten maken voor mkb'ers
Re: The solution for Short (SEO Friendly) URL's
« Reply #96 on: December 19, 2012, 10:55:25 PM »
Ok, I am going to further investigate. Thanks so far.  :-)

Offline Meint

  • Posts: 218
  • Gender: Male
    • website laten maken voor mkb'ers
Re: The solution for Short (SEO Friendly) URL's
« Reply #97 on: December 19, 2012, 11:02:05 PM »
Hi Ruud,

I could also use the news module as a blog. The short url does work for that. Do you know how to make it possible to change "post" into the page title?

Offline Ruud

  • Posts: 3649
  • 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 #98 on: December 19, 2012, 11:40:32 PM »
This is going a bit too much off topic.
I have sent you a PM.

Offline nibz

  • Posts: 683
  • Gender: Male
Re: The solution for Short (SEO Friendly) URL's
« Reply #99 on: February 14, 2013, 01:30:38 PM »
Little notice with using this module: (you can list this at your "Problems" page, though this isn't a really a problem!)

The module will not load pages at the rood called:

  • Templates
  • Temp
  • Search
  • Pages
  • Modules
  • Media
  • Languages
  • Include
  • Framework
  • Admin
  • Account

And also the children will not be loading!

 

postern-length