The solution for Short (SEO Friendly) URL's

daydreamer

Hi Rudd,

I have attached an image to show the error

Ruud

Quote from: daydreamer on November 14, 2013, 04:36:24 PM
How do I get it to work with a subdomain please?
It should work fine on subdomains.
What is not working in your case?
[url=https://dev4me.com/modules-snippets/]Dev4me - WebsiteBaker modules[/url] - [url=https://wbhelp.org/]WBhelp.org[/url]

daydreamer

How do I get it to work with a subdomain please?

N1kko

Thanks for this, I have added the new droplet code but still getting error and short urls not working  :?
My Tools: MacBook Pro Retina, Coda2, Sketch 3... Couldn't live without them

DarkViper

Quote from: N1kko on September 24, 2013, 11:30:04 AM
Droplet says invalid php code  :? I'm using WB 2.8.3 latest version with this droplet code

First please disengage magic_quotes, because newer code does not care for.

<?php // for syntax highlighting only!

$sSearchPattern '/' preg_quote(WB_URL PAGES_DIRECTORY'/') . '(.*?)'
                
preg_quote(PAGE_EXTENSION'/') . '/';
if(
preg_match_all($sSearchPattern$wb_page_data$aMatches))
{
foreach($aMatches[1] as $sLink)
{
$wb_page_data str_replace(WB_URL PAGES_DIRECTORY $sLink PAGE_EXTENSION,
                            WB_URL $sLink '/',
                            $wb_page_data
                           );
}
}
return 
'';



Sorry for delay... 
But today I had to go out and enjoy the afternoon sun.  8-)
[url=http://www.youtube.com/watch?v=tmzDAz6ZvFQ]Der blaue Planet[/url] - er ist nicht unser Eigentum - wir haben ihn nur von unseren Nachkommen geliehen[br]
[i]"You have to take the men as they are... but you can not leave them like that !" :-P [/i]
[i]Das tägliche Stoßgebet: [b]Oh Herr, wirf Hirn vom Himmel ![/b][/i]

N1kko

My Tools: MacBook Pro Retina, Coda2, Sketch 3... Couldn't live without them

DarkViper

[url=http://www.youtube.com/watch?v=tmzDAz6ZvFQ]Der blaue Planet[/url] - er ist nicht unser Eigentum - wir haben ihn nur von unseren Nachkommen geliehen[br]
[i]"You have to take the men as they are... but you can not leave them like that !" :-P [/i]
[i]Das tägliche Stoßgebet: [b]Oh Herr, wirf Hirn vom Himmel ![/b][/i]

N1kko

Magic quotes now off, but droplet still says php errors :?
My Tools: MacBook Pro Retina, Coda2, Sketch 3... Couldn't live without them

N1kko

Is this error with server or caused by WB Revision 1960?
My Tools: MacBook Pro Retina, Coda2, Sketch 3... Couldn't live without them

N1kko

Thanks badknight,

Yes magic quotes are on on my host, is there a way to fix the short url droplet? I'm no php expert at all  :?
My Tools: MacBook Pro Retina, Coda2, Sketch 3... Couldn't live without them

badknight

there are many erros

(e.g "nwlinkend, preg_match_all,..) look at the php - Info  is there magic_quotes_gpc on? (http://php.net/manual/en/security.magicquotes.php)

Ich würde gern die Welt verändern, doch Gott gibt mir den Quellcode nicht...

N1kko

Droplet says invalid php code  :? I'm using WB 2.8.3 latest version with this droplet code

global $wb;
$wb->preprocess( $wb_page_data);
$linkstart = WB_URL.PAGES_DIRECTORY;
$linkend = PAGE_EXTENSION;
$nwlinkstart = WB_URL;
$nwlinkend = \'/\';

preg_match_all(\'~\'.$linkstart.\'(.*?)\\\\\'.$linkend.\'~\', $wb_page_data, $links);
foreach ($links[1] as $link) {
    $wb_page_data = str_replace($linkstart.$link.$linkend, $nwlinkstart.$link.$nwlinkend, $wb_page_data);
}
return true;
My Tools: MacBook Pro Retina, Coda2, Sketch 3... Couldn't live without them

daydreamer


Ruud

Quote from: daydreamer on August 21, 2013, 08:44:22 PM
How can I add a 404 error page as it just redirect back to main url
Have a look in short.php and find lhe line:
define('ERROR_PAGE' , '/'); //Change this to point to your existing 404 page.
Change the '/' with the (short) name of your 404 page.

Example:
define('ERROR_PAGE' , '/my404page'); //Change this to point to your existing 404 page.
[url=https://dev4me.com/modules-snippets/]Dev4me - WebsiteBaker modules[/url] - [url=https://wbhelp.org/]WBhelp.org[/url]

daydreamer

How can I add a 404 error page as it just redirect back to main url

badknight

#122
Quote from: jacobi22 on August 01, 2013, 01:16:16 PM
in my own page i use the older version of the short-url-script and it works without problem
in a new local wb 2.8.4 project i test the shorturl 3.0 and i have only 404-Errors
the rewrite works in the links and in the adress line from the browser.
Whats the problem here?
in the short.php

you can try to debug the problem:
try to commend out the include /chdir and make a simple echo $fullpag;
now you can see the PATH - is there a Error or is it correct?
Ich würde gern die Welt verändern, doch Gott gibt mir den Quellcode nicht...

jacobi22

in my own page i use the older version of the short-url-script and it works without problem
in a new local wb 2.8.4 project i test the shorturl 3.0 and i have only 404-Errors
the rewrite works in the links and in the adress line from the browser.
Whats the problem here?

jacobi22

#120
Quotealthough the [[shorturl]] still shows on the template at the top.

Droplets need the Code register_frontend_modfiles('js') in the head of your Template-index.php
here a sample, which include frotend.css and frontend.js, but not jquery files
<?php
        
// automatically include optional WB module files (frontend.css, frontend.js)
        
register_frontend_modfiles('css');
        
// register_frontend_modfiles('jquery');
        
register_frontend_modfiles('js');
?>

daydreamer

I am using the latest bakery version.

The continue url in the form is showing as http://domain.com/pages/bakery.php and not http://domian.com/bakery

If I change {SETTING_CONTINUE_URL} in the form to http://domian.com/bakery it works although the [[shorturl]] still shows on the template at the top.

dbs

Should be solved in Bakery 1.6.
Your version is?
[url="https://onkel-franky.de"]https://onkel-franky.de[/url]

daydreamer

Having an issue with bakery. When you get to submit order and submit it takes me back to previous page and not through to fill out address. I can see [[shorturl]] at the top of the page which I then realised shorturl was causing the error.

I removed the short urls and it worked fine so not really sure what the problem is.

daydreamer

Great work Rudd think this should be hard coded into WB  :-D

Ruud

Just put v3 on http://short.dev4me.nl/download/

Nothing is changed in howto use it for new websites.
If you already are using a previous version the droplet/htaccess/short.php all need to be replaced.
[url=https://dev4me.com/modules-snippets/]Dev4me - WebsiteBaker modules[/url] - [url=https://wbhelp.org/]WBhelp.org[/url]

N1kko

My Tools: MacBook Pro Retina, Coda2, Sketch 3... Couldn't live without them

N1kko

My Tools: MacBook Pro Retina, Coda2, Sketch 3... Couldn't live without them