The solution for Short (SEO Friendly) URL's

Ralleman

#87
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: https://forum.websitebaker.org/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!

Ruud

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.

[url=https://dev4me.com/modules-snippets/]Dev4me - WebsiteBaker modules[/url] - [url=https://wbhelp.org/]WBhelp.org[/url]

Ralleman

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

Ruud

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.
[url=https://dev4me.com/modules-snippets/]Dev4me - WebsiteBaker modules[/url] - [url=https://wbhelp.org/]WBhelp.org[/url]

Ralleman

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

dbs

Thx Ruud, the 404 is solved.
Also the droplet lastmodifiedpages shows now usable links.  :wink:
[url="https://onkel-franky.de"]https://onkel-franky.de[/url]

Ruud

The problem must be found in this part

# 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)

# If called directly - redirect to short url version
RewriteCond %{REQUEST_URI} wb/pages
RewriteRule ^wb/pages/(.*).php$ /wb/$1/ [R=301,L]
[url=https://dev4me.com/modules-snippets/]Dev4me - WebsiteBaker modules[/url] - [url=https://wbhelp.org/]WBhelp.org[/url]

dbs

should be the original-code. nothing else in htaccess.
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]
[url="https://onkel-franky.de"]https://onkel-franky.de[/url]

Ruud

Quote from: dbs on September 27, 2012, 11:09:27 PM
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?
[url=https://dev4me.com/modules-snippets/]Dev4me - WebsiteBaker modules[/url] - [url=https://wbhelp.org/]WBhelp.org[/url]

dbs

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".
[url="https://onkel-franky.de"]https://onkel-franky.de[/url]

jacobi22

#77
Try this -> https://forum.websitebaker.org/index.php/topic,22371.0.html  :wink:
(works not with the Rev's > 1532)

dbs

#76
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)?
[url="https://onkel-franky.de"]https://onkel-franky.de[/url]

daydreamer

Great thanks wasn't aware you needed the droplet as well

Ruud

First create the droplet and paste the content of the file "dropletcode.txt" in there.
Name the new droplet something like "shorturl".
Somewhere in the html output of your template index.php (i.e. directly after the </html>) write [[shorturl]]

That should do it.
[url=https://dev4me.com/modules-snippets/]Dev4me - WebsiteBaker modules[/url] - [url=https://wbhelp.org/]WBhelp.org[/url]

daydreamer

No how do I add it in to the template index.php?
Thanks

nibz

Dit you enclude the short url droplet in your template?!

daydreamer

My pages change from

/pages/about.php

to
/about

but links are still /pages/about.php and not /about

Ruud

Released a new version (2.3) today that fixes a problem with not translated links in WYSIWYG sections when using WB2.8.3.

See: http://short.allwww.nl/download
[url=https://dev4me.com/modules-snippets/]Dev4me - WebsiteBaker modules[/url] - [url=https://wbhelp.org/]WBhelp.org[/url]

dbs

[url="https://onkel-franky.de"]https://onkel-franky.de[/url]

Ruud

You should be able to do that by chaging the droplet and the short.php.

For SEO reasons I would not advice this if you ever want to start using the /de/ in the future.
At that time you will need to rebuild your ranking all over again.
[url=https://dev4me.com/modules-snippets/]Dev4me - WebsiteBaker modules[/url] - [url=https://wbhelp.org/]WBhelp.org[/url]

dbs

#67
Hello,

is it possible?
I've made a multilingual-site, but use at the moment only one language (de).
My wish is: all pages have url without pages/de/ and the home-page shows only www.domain.de instead www.domain.de/de/home/

Can short-url do this?

dbs
[url="https://onkel-franky.de"]https://onkel-franky.de[/url]

dana

Oh, ok. I thought it was something on my end. :) Thank you, Xagone! :)
[url=http://www.dana-svedova.cz]Webdesign by Dana[/url]

Xagone

I seen this on my multilingual websites too, it's normal because WB try to force a lang var and the htaccess repeat it the first time.

but it should not affect SEO.
Xagone Inc. (formerly VotreEspace)
[url="http://xagone.com/"]http://xagone.com/[/url]

dana

I seem to be having problems with my multilanguage site. I've tried clicking around and this happened:

1) I clicked to switch to non-default english.
2) Then I clicked back to default language.
3) Then back to english version - this appeared in the address bar:

http://www.dana-svedova.cz/en/home/?_page=en/home/&lang=EN

When I click about in the english version, sometimes the address bar has that gibberish on multiple pages. When I hover over links, the format is the correct one, ie. blabla/en/home/

Does anyone have any idea what could be wrong?
[url=http://www.dana-svedova.cz]Webdesign by Dana[/url]

daydreamer

Great thanks works fine, would be nice to see it work with other modules in the future  :-)