Jump to content

Jumplinks


Mike Rockett

Recommended Posts

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.

Link to comment
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
Link to comment
Share on other sites

  • 4 weeks later...

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...

Link to comment
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?

Link to comment
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…

Link to comment
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
Link to comment
Share on other sites

  • 1 month later...

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. 

 

 

Link to comment
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.

Link to comment
Share on other sites

  • 4 weeks later...

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!

Link to comment
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

Link to comment
Share on other sites

  • 2 weeks later...

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
Link to comment
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.

Link to comment
Share on other sites

  • 3 weeks later...

@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.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...