Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2015-05-15 06:29:22

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,007
Website GitHub Mastodon Twitter

Re: arc_redirect

thanks Andy, no worries re the slow response.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#14 2016-08-23 17:21:05

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: arc_redirect

Hi Andy,

You have no examples in your instructions to guide me along, so forgive me if I have this wrong, but I need to redirect all URLs in a given section (/section) to root domain (homepage).

In smd_redirect, it’s a simple matter of using /section in the from field and nothing (empty) in the to field for a homepage routing.

That doesn’t seem to be the same process in your plugin as the redirect won’t save when a field is empty.

I then tried using an absolute path of the homepage in the “to” field, and that saves, but a test shows no redirect happens.

Can you give some clues how to use the fields, exactly? Thanks!

Offline

#15 2016-08-23 20:04:58

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,578
Website

Re: arc_redirect

Would perhaps / work as the target url?


TXP Builders – finely-crafted code, design and txp

Offline

#16 2016-08-24 18:00:58

monkeyninja
Plugin Author
From: Sheffield, UK
Registered: 2008-10-14
Posts: 239
Website

Re: arc_redirect

Hi Destry,

Perhaps the documentation needs a bit of an update to include some clearer examples.

I’m not sure arc_redirect currently does what you’re after. It takes a literal source URL and redirects it, so you can’t set one rule to redirect all URLs from a given section to a specific rule. You’d need to define a rule for each URL. If someone’s interested in extending the plugin to support this I’d be happy to add it – just make a pull request on the repository.

If you want to redirect to the homepage using this plugin it is a simple case of using / in the ‘redirect’ field.

If you can edit the website’s .htaccess file I’d highly recommend that over using any redirect plugin as it will reduce the load on your server and your website will respond faster (better for SEO).

Offline

#17 2016-08-25 19:46:52

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: arc_redirect

I’ll probably just do that, then; go with .htaccess for all future redirect needs and yank the two redirect plugins.

Thanks.

Offline

#18 2017-03-14 12:24:51

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: arc_redirect

Thanks Andy, this plugin is just what I needed. Jukka’s security audit engenders a lot of confidence, too. :)

Edit: Working beautifully so far. However, when I use the test feature on my dev server, I’m getting a 404 (not from Txp, but from the server). I’m sure it has to do with my server settings but would appreciate any hints.

Edit #2: OK, clear enough: the test feature uses the URL as written, even when it is a root-relative URL.

Edit #3: OK, I’m not awake yet. The issue is that I use a different subdomain for admin.

Edit #4: Sent you a PR on GitHub.

Last edited by jsoo (2017-03-14 13:11:58)


Code is topiary

Offline

#19 2018-11-24 09:49:43

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,578
Website

Re: arc_redirect

Hi Andy,

have recently upgraded a site to https:// but have not (yet) forced a redirect to https in .htaccess so that both http and https links still work. I’m using /relative-links in the “redirect from” field and the redirects are successful if the incoming link begins with http but not if the user (or their browser) uses https for the incoming link. Is there anything I can do to get it working reliably with https://… links?


TXP Builders – finely-crafted code, design and txp

Offline

#20 2018-11-24 13:26:47

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,578
Website

Re: arc_redirect

I made some mini alterations/simplifications to the redirection routine in the plugin that seem to have resolved the problem for me, although I’m not entirely sure why (I just used more of the built-in txp functions). If you fancy taking a look or correcting my alterations, take a look at my fork on GitHub. If I get some time, I may see if I can resolve the mini display glitches on txp 4.7. too.

Best wishes to you and the Steel City where I once lived many moons ago.


TXP Builders – finely-crafted code, design and txp

Offline

#21 2020-03-11 00:29:08

peterj
Member
From: Melbourne, Australia
Registered: 2005-06-02
Posts: 99

Re: arc_redirect

v1.2 is throwing a fatal error on TXP 4.8. Jakob’s v1.3 throws same. Is it best to use htaccess, or is there a simple fix for the register_tab() issue?

Fatal error: Uncaught Error: Call to undefined function register_tab() in /home/abc/public_html/xyz/textpattern/plugins/arc_redirect/arc_redirect.php:6 Stack trace: #0 /home/abc/public_html/xyz/textpattern/lib/txplib_misc.php(1412): include() #1 /home/abc/public_html/xyz/textpattern/publish.php(234): load_plugins() #2 /home/abc/public_html/xyz/index.php(69): include(‘/home/abc/…’) #3 {main} thrown in /home/abc/public_html/xyz/textpattern/plugins/arc_redirect/arc_redirect.php on line 6

Offline

#22 2020-03-11 10:20:47

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,578
Website

Re: arc_redirect

Hi Peter,

See if v1.3.2 works for you.

Changes made:

  • The plugin is more specific about what it executes in the admin area and what it does on the public side.
  • Render the input form properly when the plugin is newly installed and no redirects are present.
  • Minor Textpack updates.

Worked for me on txp 4.8 with php 7.2 in brief testing.


TXP Builders – finely-crafted code, design and txp

Offline

#23 2020-03-23 00:53:16

peterj
Member
From: Melbourne, Australia
Registered: 2005-06-02
Posts: 99

Re: arc_redirect

Hi Jakob,
sorry I just found the email notification of your post. I’ve installed and this works just fine (PHP 7.1), Thank you!

Offline

Board footer

Powered by FluxBB