Jump to content

Release: Redirects


apeisa

Recommended Posts

is there a set up to send /old-page/* to /new-page/*

Not currently, but it shouldn't be too difficult to add while Mike Anthony gets his version complete. I'm looking forward to his version myself—so long as I can specify my alt domain. *wink*

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...

Finally got a chance to use this module. Thank you apeisa! I installed it on current stable (2.5.3) and tested probably every function. I can state it is compatible with PW 2.5. If someone else could confirm that, maybe it can be stated on module page, so people would not be scared off by compatibility problems.

@Mike Anthony: Patiently waiting for your new module. I was impressed by your Bolt redirect module satated functionality! When finished, your PW module should get almoast all use cases covered.

  • Like 1
Link to comment
Share on other sites

Finally got a chance to use this module. Thank you apeisa! I installed it on current stable (2.5.3) and tested probably every function. I can state it is compatible with PW 2.5. If someone else could confirm that, maybe it can be stated on module page, so people would not be scared off by compatibility problems.

I updated the module page, thanks for the heads up Ivan!

  • Like 1
Link to comment
Share on other sites

@mike: Not sure where you defined it but normally you have to create and delete admin pages manually in the ___install() and ___uninstall() functions (Example: https://github.com/NicoKnoll/ProcessTemplateEditor/blob/master/ProcessTemplateEditor.module#L264-L311)

Edit: maybe I missed an Ryan-update and there is an easier way now.

Link to comment
Share on other sites

@Nico - there is an easier way. One can now define the pages in the info, which can also be in a JSON file:

"page": {
    "name": "the-name",
    "parent": "setup",
    "title": "The Title"
},
 
So I know I can manually uninstall the page - but it should do this automatically. Haven't checked out the source though...
  • Like 1
Link to comment
Share on other sites

Nico, I really like that idea. Crazy simple.

But wait, before I do that - will it interfere with a conditional install? In other words, I'm checking to see if the original redirects module is installed before installing my module...

Edit: However, I've always used parent::init()... Didn't do the [un]install automagically...

Link to comment
Share on other sites

I think the feature Nico is talking about was added in the dev branch a while back? IIRC...can't find a link atm... :-). To be clear parent::init() has been there for a while...what I am referring to is the 'uninstall' feature Nico is talking about...if memory serves me right!

Edited by kongondo
  • Like 1
Link to comment
Share on other sites

I'm on the latest dev, but, for some reason, it didn't auto-[un]install. Here's the code of the init method in Process.php:

public function init() { 
	$class = $this->className();
	$info = $this->wire('modules')->getModuleInfo($this, array('verbose' => false)); 
	$version = (int) isset($info['version']) ? $info['version'] : 0;
	if(is_file($this->config->paths->$class . "$class.css")) $this->config->styles->add($this->config->urls->$class . "$class.css?v=$version"); 
	if(is_file($this->config->paths->$class . "$class.js")) $this->config->scripts->add($this->config->urls->$class . "$class.js?v=$version"); 
}
Link to comment
Share on other sites

So I'm hacking away at the new module right now, and I need to ask if anyone needs the following features:

1. PassThroughs - keep the old url and serve content at a new url. I don't think anyone will need this, but I'd like to know if anyone does, and how important it is to them.

2. The ability to set HTTP Status Codes (301, 302, 307) on a per-redirect basis. I guess this is handy for temporary stuff, like for short URLs...

3. The ability to set a start and end date for the redirection

I guess that 2 and 3 go with one another. In other words, if I set a start and end date, the redirect should be 302. Am I right? If so, would number two be redundant?

Update - I'm not doing feature 1. Features 2 and 3 are being done, but the outcome of feature 2 will be determined what is set for feature 3.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...