Jump to content

Recommended Posts

@rareyush My apologies for the late response here. Haven't had a chance to look into it yet. What is the domain of the new site? Is it live at the moment? Thinking I'd need to take a look and see what happens - if you could provide some more info. Thanks!

Share this post


Link to post
Share on other sites
On 9/23/2018 at 8:26 AM, Mike Rockett said:

@panx Thanks for the report – please could you have a look in your server logs to see what the error is?

@Mike Rockett [Wed Sep 26 11:27:17.253274 2018] [core:alert] [pid 13619] [client **] /home/httpd/vhosts/**/.htaccess: Invalid command 'RewriteCond\xef\xbb\xbf', perhaps misspelled or defined by a module not included in the server configuration, referer: https://**/pw/setup/jumplinks/

I don't get this properly done - lack of knowledge of .htaccess coding. Please don't ask me for the current htaccess code, it's rubbish.

How can I rewrite the original URL to the deseried URL?

Original URL:
/index.php?reference=kunststoff&object=1
/index.php?article-group=a&article-number=101.030

Desired destination URL:
/reference/kunststoff/object/1
/article-group/a/article-number/101.030

With this desired destination URL, i will be able to pass through jumplinks to reach the final URL.

Share this post


Link to post
Share on other sites

@panx - looks like there might be an encoding issue with the RewriteCond directive there... Not sure how it would have happened, but my best guess would be to type the directives in manually.

Also, the second RewriteCond line in that state won't apply to you. You'd likely need a catch-all of sorts to match the different types. I'm not able to test this as I no longer use Apache, but this could work:

RewriteCond %{REQUEST_URI} ^\/index\.php [NC]
RewriteCond %{QUERY_STRING} ^(.+)$ [NC]
RewriteRule ^ /index_php/%1? [R,L]

From there, you'd be able to create a jumplink for index_php/reference={reference:segment}&object={object:num}, which could then be directed to reference/{reference}/object/{object}.

  • Thanks 1

Share this post


Link to post
Share on other sites

@Mike Rockett thank you for your help!

With the following modification, I was able to do the jumplink stuff.

RewriteCond %{REQUEST_URI} ^\/index\.php [NC]
RewriteCond %{QUERY_STRING} ^(.+)$ [NC]
RewriteRule ^ /index2.php?%1? [R,L]
  • Like 1

Share this post


Link to post
Share on other sites

I am experiencing problems when the source URL contains '('.

So, it works when I use 'something.html' as source, but when using 'something-(other).html' I get this error:

Not Found

The requested URL /something-(other).html was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.


Apache/2.4.34 (Win32) OpenSSL/1.0.2o PHP/5.6.37 Server at es-local Port 80

I have a couple of old links that use '(' and would rather not mess with .htaccess. 

I have checked "Turn debug mode on" but nothing changes

Appreciate your help...

Share this post


Link to post
Share on other sites

Also, how would you strip a ',' from the link? PW doesn't seem to allow those, but I have them in previous links...

Share this post


Link to post
Share on other sites

@Mike Rockett

// Get the correct table name for ProcessRedirects
        $redirectsTableNameQuery = $this->database->prepare('SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = :db_name AND TABLE_NAME LIKE :table_name');
        $redirectsTableNameQuery->execute(array(
            'db_name' => $this->config->dbName,
            'table_name' => $this->redirectsTableName,
        ));
        if ($redirectsTableNameQuery->rowCount() > 0) {
            $redirectsTableNameResult = $redirectsTableNameQuery->fetch(PDO::FETCH_OBJ)->TABLE_NAME;
            if ($this->redirectsTableName == $redirectsTableNameResult ||
                strtolower($this->redirectsTableName) == $redirectsTableNameResult) {
                $this->redirectsTableName = $redirectsTableNameResult;
            }
        }

Mike, why are you doing this? And why are you doing this in the constructor? As far as I can see it is just used in the "___executeImport" function. Which I suspect is called only once when doing whatever kind of import that is.

I don't even have that table in my database. Yet as the code is placed in the constructor every time a page is called there is this request to information_schema. This leads to a high database load due to a lot of permission requests.

I suspect you can move that to the import function?

Share this post


Link to post
Share on other sites

@DarsVaeda – Thanks for bringing that up. I did indeed plan to move it some time back, but then decided to only do it for v2, which, hasn't been under active development of late. I'll try find some time to sort this out on v1 soon. Sorry for the issues caused here. 🙂

@gr00__ (sorry, not sure why it's not tagging you) – That would likely be due to PW’s htaccess rules, as the error is coming from Apache. As that's where its coming from, you'd need to create a rule that will strip out those characters. Haven't worked with htaccess for a long time now, so not confident that I can assist accurately…

Share this post


Link to post
Share on other sites
On 10/27/2018 at 6:46 PM, Mike Rockett said:

@DarsVaeda – Thanks for bringing that up. I did indeed plan to move it some time back, but then decided to only do it for v2, which, hasn't been under active development of late. I'll try find some time to sort this out on v1 soon. Sorry for the issues caused here. 🙂

I've just moved it down to the function without anything popping up in error log. Load is down by 90% at least, site speed has improved dramatically as well. I'd suggest you really look into this asap 😉

  • Like 2

Share this post


Link to post
Share on other sites

Can the module redirect to destination including query strings or anything after the / for example? I have tried numerous things but no joy. Having to do this in .htaccess:

RewriteRule ^old-page/(.*) /new-folder/new-page/$1 [L,R]

Cheers. 

 

 

Share this post


Link to post
Share on other sites
On 12/8/2018 at 10:04 AM, Mike Rockett said:

@cb2004 – https://jumplinks.rockett.pw/features/smart-wildcards.html – you'll probably want to use {segments} or {all} here. 🙂

That done the trick, I had to turn off cleaning for things like ?utm_source=X&utm_source=Y. What caught me out here was page:1000{all} didn't work, fine once I realised though.

Share this post


Link to post
Share on other sites

We've had some issues redirecting urls that include a tilde (~/media/) in it.  We are moving over a site that makes heavy use of urls like that from the previous version.  Is this something we can handle with jumplinks or do we need to try to do that in the .htaccess?  We can get the URL to show in the list, but Jumplinks will never register a hit against it.  Do you have a recommendation on how to handle urls like this?

 

Thank you!

Share this post


Link to post
Share on other sites

Hi Mike

When creating a jumplink, there's a link to your site for examples.

Currently generating a 404 error

 

Share this post


Link to post
Share on other sites
8 hours ago, Mike Rockett said:

Hey @Peter Knight – weird, the redirects should be working… Will take a look, thanks 🙂

Edit: Hmm, the links appear to be correct on the latest version…

Hi Mike

Must be an out-dated version of Jumplinks (1.5.48)

The Examples link goes here: https://rockett.pw/jumplinks/examples

Share this post


Link to post
Share on other sites
6 minutes ago, Mike Rockett said:

Indeed - 1.5.50 has the correct links. 🙂

Good excuse to use Jumplinks here 🙂

Share this post


Link to post
Share on other sites
Just now, Peter Knight said:

Good excuse to use Jumplinks here 🙂

Haha, if only the site site was PW-powered. It's just a lander running on Netlify. Might add in some sort of wildcard redirect to the new docs home. 🙂

Share this post


Link to post
Share on other sites

Don't have a chance to look into this right now, but is anyone having issues on PHP 7.3? Saw a comment on the module listing from Alex Capes about it breaking. In the meantime, I've opened up an issue over at GitLab: https://gitlab.com/rockettpw/seo/jumplinks-one/issues/1

@Karinne Cyphers - only saw your note now, sorry about that! It's likely due to rules 16a/16b in htaccess. 16a limits the characters allowed in a URL, so hits would never even boot up ProcessWire. Try changing to 16b (and adding the tilde if it's not there).

 

———

Future Development / v2

I profusely apologise for how long it's taken to get things done for v2. As some of you know, my daily responsibilities have taken over, and committing time to open-source projects is not there as it once was. I'd love to be able to say that I can try find some time to get to it, but it's simply a promise I can't make or keep, unfortunately…

The way I see it, there are two options on the table. First is to wait it out (I know, I know…) – I do have a project board on the old repo, so I know what stands where and what I'd envisioned for the module, and can pick things up where I left off last (phew, haven't touched jQuery in forever – that might be a challenge), when the time avails itself. Technically, I'm about half way there but there's still quite a bit of work to do in terms of frontend. Second option would be for someone to take over the project. It'd definitely need to be someone who can commit the time to its development, and develop in line with the way in which the module has been built so far (there's a decent amount of SoC going on, and the module is built up using packages such as Eloquent, FastRoute, etc.). Alternatively, as a third option, we could take a multi-contributor approach. So, if anyone is interested, feel free to send me a DM and we can chat about it.

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites
On 1/22/2019 at 5:38 PM, Mike Rockett said:

Don't have a chance to look into this right now, but is anyone having issues on PHP 7.3? Saw a comment on the module listing from Alex Capes about it breaking. In the meantime, I've opened up an issue over at GitLab: https://gitlab.com/rockettpw/seo/jumplinks-one/issues/1

Running PHP 7.3.1 with the latest version of Jumplinks return a blank page for me.

PHP 7.2.14 seems to work fine.

Share this post


Link to post
Share on other sites

@Mike RockettThank you for the advice... we've tried that but we are not having any luck.  Moreover, we've noticed now that all our redirects are failing and will either error out or get stuck in a loop.  We are getting this error for users not logged in with Tracy: Warning: preg_replace_callback(): Compilation failed: invalid range in character class at offset 6 in   /var/www/html/site/assets/cache/FileCompiler/site/modules/ProcessJumplinks/ProcessJumplinks.module.php

I'm thinking this may have something to do with PHP 7.3.x.  We are running both 7.3.1 and 7.3.2 on our dev and production machines.  Any advice for a workaround?

Thank you.

Share this post


Link to post
Share on other sites

Did you try to delete everything in site/assets/cache/FileCompiler/site/modules/ProcessJumplinks/ ?

And maybe also go to modules > clear compiled files (button at the bottom).

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By gebeer
      Although the PW backend is really intuitive, ever so often my clients need some assistance. Be it they are not so tech savvy or they are not working in the backend often.
      For those cases it is nice to make some help videos available to editors. This is what this module does.
      ProcessHelpVideos Module
      A Process module to display help videos for the ProcessWire CMS. It can be used to make help videos (screencasts) available to content editors.
      This module adds a 'Help Videos" section to the ProcessWire backend. The help videos are accessible through an automatically created page in the Admin page tree. You can add your help videos as pages in the page tree. The module adds a hidden page to the page tree that acts as parent page for the help video pages. All necessary fields and templates will be installed automatically. If there are already a CKEditor field and/or a file field for mp4 files installed in the system, the module will use those. Otherwise it will create the necessary fields. Also the necessary templates for the parent help videos page and it's children are created on module install. The module installs a permission process-helpvideos. Every user role that should have access to the help video section, needs this permission. I use the help video approach on quite a few production sites. It is stable so far and well received by site owners/editors. Up until now I installed required fields, templates and pages manually and then added the module. Now I added all this logic to the install method of the module and it should be ready to share.
      The module and further description on how to use it is available on github: https://github.com/gebeer/ProcessHelpVideos
      If you like to give it a try, I am happy to receive your comments/suggestions here.
    • By Robin S
      A module created in response to the topic here:
      Page List Select Multiple Quickly
      Modifies PageListSelectMultiple to allow you to select multiple pages without the tree closing every time you select a page.
      The screencast says it all:

       
      https://github.com/Toutouwai/PageListSelectMultipleQuickly
      https://modules.processwire.com/modules/page-list-select-multiple-quickly/
    • By gebeer
      Hello all,
      sharing my new module FieldtypeImagePicker. It provides a configurable input field for choosing any type of image from a predefined folder.
      The need for it came up because a client had a custom SVG icon set and I wanted the editors to be able to choose an icon in the page editor.
      It can also be used to offer a choice of images that are used site-wide without having to upload them to individual pages.
      There are no image manipulation methods like with the native PW image field.
      Module and full description can be found on github https://github.com/gebeer/FieldtypeImagePicker
      Kudos to @Martijn Geerts. I used his module FieldTypeSelectFile as a base to build upon.
      Here's how the input field looks like in the page editor:

      Hope it can be of use to someone.
      If you like to give it a try, I'm happy to hear your comments or suggestions for improvement. Eventually this will go in the module directory soon, too.
    • By bernhard
      @Sergio asked about the pdf creation process in the showcase thread about my 360° feedback/survey tool and so I went ahead and set my little pdf helper module to public.
      Description from PW Weekly:
       
      Modules Directory: https://modules.processwire.com/modules/rock-pdf/
      Download & Docs: https://github.com/BernhardBaumrock/RockPDF
       
      You can combine it easily with RockReplacer: 
      See also a little showcase of the RockPdf module in this thread:
       
    • By ukyo
      FieldtypeFontIconPicker
      Supported Icon Libraries
      FontAwesome 4.7.0 Uikit 3.0.34 IonicIcons 2.0.1 Cahangelog
      NOTE: Module store data without prefix, you need to add "prefix" when you want to show your icon on front-end, because some of front-end frameworks using font-awesome with different "prefix".
      Module will search site/modules/**/configs/IconPicker.*.php and site/templates/IconPicker.*.php paths for FieldtypeFontIconPicker config files.
      All config files need to return a PHP ARRAY like examples.
      Example config file : create your own icon set.
      File location is site/configs/IconPicker.example.php
      <?php namespace ProcessWire; /** * IconPicker : Custom Icons */ return [ "name" => "my-custom-icons", "title" => "My Custom Icon Set", "version" => "1.0.0", "styles" => array( wire("config")->urls->templates . "dist/css/my-custom-icons.css" ), "scripts" => array( wire("config")->urls->templates . "dist/js/my-custom-icons.js" ), "categorized" => true, "attributes" => array(), "icons" => array( "brand-icons" => array( "title" => "Brand Icons", "icons" => array( "google", "facebook", "twitter", "instagram" ) ), "flag-icons" => array( "title" => "Flag Icons", "icons" => array( "tr", "gb", "us", "it", "de", "nl", "fr" ) ) ) ]; Example config file : use existing and extend it.
      File location is site/configs/IconPicker.altivebir.php
      <?php namespace ProcessWire; /** * IconPicker : Existing & Extend */ $resource = include wire("config")->paths->siteModules . "FieldtypeFontIconPicker/configs/IconPicker.uikit.php"; $url = wire("config")->urls->templates . "dist"; $resource["scripts"] = array_merge($resource["scripts"], ["{$url}/js/Altivebir.Icon.min.js"]); $resource["icons"]["flag-icons"] = [ "title" => "Flag Icons", "icons" => array("tr", "en", "fr", "us", "it", "de") ]; $resource["icons"]["brand-icons"]["icons"] = array_merge($resource["icons"]["brand-icons"]["icons"], array( "altivebir" )); return $resource; After you add your custom config file, you will see your config file on library select box. Library Title (Location Folder Name).

      If your library categorized and if you have categorized icons set like uikit and fontawesome libraries, you will have category limitation options per icon field or leave it empty for allow all categories (default).

      Example : output
      if ($icon = $page->get("iconField")) { echo "<i class='prefix-{$icon}' />"; } MarkupFontIconPicker Usage
      // MarkupFontIconPicker::render(YourIconField=string, Options=array) echo MarkupFontIconPicker::render($page->YourIconField, [ 'prefix' => 'uk-icon-', // Icon class prefix, if you have different prefix, default is : "fa fa-" 'tag' => 'span', // Icon tag default is : "i" 'class' => 'fa-lg', // If you have extra cutom classes, for example : icons sizes, Array or Sting value 'style' => 'your custom styles if you have' // Array or String Value ]); Theme support

      Search support

      Category support

       
×
×
  • Create New...