Torsten Baldes Posted October 29, 2014 Share Posted October 29, 2014 @renobird do you plan to release this extended module any time soon? thanks! Link to comment Share on other sites More sharing options...
renobird Posted October 29, 2014 Share Posted October 29, 2014 Here is a beta version for anyone who wants to test. [updated Link Below] Use an asterisk to specify a wildcard. Example: /somepage/* This will (should) catch everything under /somepage/ The main differences: - Hook is now "addHookBefore" - SQL has changed to allow searching for wildcard - Alternate Domain config field under module settings. 5 Link to comment Share on other sites More sharing options...
renobird Posted October 29, 2014 Share Posted October 29, 2014 Also, I find what you're wanting to do with your site quite interesting. I have a question: why would you want to maintain the URI structure for the legacy site, instead of performing permanent redirects? If it's something that many developers do, I'd be willing to include the functionality in the new module This isn't something I've ever needed before, but in this case, I need to maintain an aging IIS/MSSQL/.NET infrastructure that has sites and applications that don't warrant the development time to rebuild. There is an assortment of reasons why it needs to live on. Link to comment Share on other sites More sharing options...
renobird Posted October 29, 2014 Share Posted October 29, 2014 Hang tight on that version. I just realized that wasn't the most current. I copied an earlier version by mistake in my rush to get to lunch. I'll be back in front of my computer in a bit and will post the correct version. Link to comment Share on other sites More sharing options...
Torsten Baldes Posted October 29, 2014 Share Posted October 29, 2014 Thanks! Can i just update my current version or should i uninstall it first? Link to comment Share on other sites More sharing options...
renobird Posted October 29, 2014 Share Posted October 29, 2014 I wouldn't use this in a production environment yet. You should be able to install over your old version, no DB schema changes. Link to comment Share on other sites More sharing options...
Mike Rockett Posted October 30, 2014 Share Posted October 30, 2014 This isn't something I've ever needed before, but in this case, I need to maintain an aging IIS/MSSQL/.NET infrastructure that has sites and applications that don't warrant the development time to rebuild. There is an assortment of reasons why it needs to live on. I see - makes sense indeed Link to comment Share on other sites More sharing options...
renobird Posted October 30, 2014 Share Posted October 30, 2014 Just a quick note. We did a lot more testing here over the past few days. Made a few tweaks to the SQL, and added a new config option for response codes that trigger the redirect to another domain. Defaults are 200 and 301. I'll post the updated version when I get to the office tomorrow. 1 Link to comment Share on other sites More sharing options...
renobird Posted October 31, 2014 Share Posted October 31, 2014 OK, I think I'm all done fiddling. This latest version seems really stable, and ready for primetime. I would still suggest that you test it in a development environment first. ProcessRedirects.zip Configuration fields Wildcard redirects 6 Link to comment Share on other sites More sharing options...
adrian Posted October 31, 2014 Share Posted October 31, 2014 Hey Tom, This sounds great! Maybe it already does this, but just a quick suggestion - would it work to have the wildcard used in the destination path so that: with your example /programs/* rule: /programs/my-program/ would get redirected to /about/programs/my-program/ 1 Link to comment Share on other sites More sharing options...
renobird Posted October 31, 2014 Share Posted October 31, 2014 Hi Adrian, I'll need to see how complex that would be. I don't have an immediate need, so not sure I can devote time to it at the moment. EDIT: I bet what Mike Anthony is building would accommodate that. His looks to have a lot more features. Link to comment Share on other sites More sharing options...
adrian Posted October 31, 2014 Share Posted October 31, 2014 EDIT: I bet what Mike Anthony is building would accommodate that. His looks to have a lot more features. Good point! I will have a need for this early next year. If it hasn't been tackled, I'l look into it then. Link to comment Share on other sites More sharing options...
Mike Rockett Posted October 31, 2014 Share Posted October 31, 2014 Adrian, Tom - Indeed, it will support that, quite fully. It would be a case of directing /programs/{program:segment} to /about/programs/{program}. I'm sure it'll be ready by the time you need it, Adrian. I worked on a bit yesterday (importing). I have exporting on the to-do list, but I wonder how necessary it is. I may just leave it out, until someone needs it. Or perhaps we put it to a vote, or discuss further. Anyways, by the end of next month, I'd like to have a beta put up. I know it sounds like a long way away, but I assure you, if I had time on my hands, this module would be finished by Friday next week, if not sooner. Edit: I need to get everyone first names right! Hehe! 2 Link to comment Share on other sites More sharing options...
Mike Rockett Posted November 2, 2014 Share Posted November 2, 2014 Hey Tom - so I have a question about the alternate domain status codes: Why would we redirect to the domain (and URI) if it returns a 301? Surely you would redirect to it only if it returned a 200? Link to comment Share on other sites More sharing options...
renobird Posted November 2, 2014 Share Posted November 2, 2014 Hi Mike, I originally had hardcoded the module to only redirect if the alt domain and URI returned a 200, but in my case the alternate domain has 13 years of vanity URI's that I don't want to migrate. So I figured it would be good to have it configurable. 200, 301, 302 are the ones I get back most. Link to comment Share on other sites More sharing options...
Mike Rockett Posted November 2, 2014 Share Posted November 2, 2014 I see - so it wouldn't be a common thing then, I guess. I was just thinking if I needed to include it in my module. Link to comment Share on other sites More sharing options...
renobird Posted November 2, 2014 Share Posted November 2, 2014 The alternate domain option is probably uncommon in general. If you include it, would you mind making the status codes configurable? That way I could potentially use your module. 1 Link to comment Share on other sites More sharing options...
Mike Rockett Posted November 2, 2014 Share Posted November 2, 2014 Sure, I'll include it. 1 Link to comment Share on other sites More sharing options...
MartinN Posted November 24, 2014 Share Posted November 24, 2014 I am not able to install the module ProcessRedirects on one of my domains. On two other domains ProcessRedirects is working perfectly, I am using the latest stable ProcessWire release 2.5.3 on all three domains.After installation the ProcessRedirects module does not appear in the setup menu. When I try to uninstall it (before clean re-installation), I get an error message “This page may not be deleted”. Removing the module manually from the /site/modules/ directory did not help as well.How to get the module working again? I also already removed the “processredirects” entry from the mySQL database.Is there any other entries I have to remove from the database (in "modules" I did not find any)?Thanks a lot for your help! Link to comment Share on other sites More sharing options...
apeisa Posted November 24, 2014 Author Share Posted November 24, 2014 Hmm.. Does it create the page under /processwire/setup, but without process assigned? You can check this from pagetree. Link to comment Share on other sites More sharing options...
MartinN Posted November 24, 2014 Share Posted November 24, 2014 You mean "Admin/Setup/Redirects" ? No, there is no such page. (I compared it with another processwire installation where ProcessRedirects is working no problem, on this installation the Redirects page is in place). I tried to install and uninstall the module several times, it might be better to completely remove the module before re-installation? Link to comment Share on other sites More sharing options...
MartinN Posted November 25, 2014 Share Posted November 25, 2014 After turning debug mode on (config.php) and trying to uninstall ProcessRedirects there is this error message (I shortened the pathes with "......"): TemplateFile: This page may not be deleted<pre>#0 [internal function]: Pages->___delete(Object(NullPage)) #1 /homepages/......./wire/core/Wire.php(389): call_user_func_array(Array, Array) #2 /homepages/......./wire/core/Wire.php(344): Wire->runHooks('delete', Array) #3 /homepages/......./wire/core/Page.php(1193): Wire->__call('delete', Array) #4 /homepages/......./wire/core/Page.php(1193): Pages->delete(Object(NullPage)) #5 /homepages/......./site/modules/ProcessRedirects/ProcessRedirects.module(343): Page->delete() #6 [internal function]: ProcessRedirects->___uninstall() #7 /homepages/......./wire/core/Wire.php(389): call_user_func_array(Array, Array) #8 /homepages/......./wire/core/Wire.php(344): Wire->runHooks('uninstall', Array) #9 /homepages/......./wire/core/Modules.php(1368): Wire->__call('uninstall', Array) #10 /homepages/......./wire/core/Modules.php(1368): ProcessRedirects->uninstall() #11 [internal function]: Modules->___uninstall('ProcessRedirect...') #12 /homepages/......./wire/core/Wire.php(389): call_user_func_array(Array, Array) #13 /homepages/......./wire/core/Wire.php(344): Wire->runHooks('uninstall', Array) #14 /homepages/......./wire/modules/Process/ProcessModule/ProcessModule.module(1155): Wire->__call('uninstall', Array) #15 /homepages/......./wire/modules/Process/ProcessModule/ProcessModule.module(1155): Modules->uninstall('ProcessRedirect...') #16 /homepages/......./wire/modules/Process/ProcessModule/ProcessModule.module(1044): ProcessModule->renderEdit('ProcessRedirect...', Array) #17 [internal function]: ProcessModule->___executeEdit() #18 /homepages/......./wire/core/Wire.php(389): call_user_func_array(Array, Array) #19 /homepages/......./wire/core/Wire.php(344): Wire->runHooks('executeEdit', Array) #20 /homepages/......./wire/core/ProcessController.php(204): Wire->__call('executeEdit', Array) #21 /homepages/......./wire/core/ProcessController.php(204): ProcessModule->executeEdit() #22 [internal function]: ProcessController->___execute() #23 /homepages/......./wire/core/Wire.php(389): call_user_func_array(Array, Array) #24 /homepages/......./wire/core/Wire.php(344): Wire->runHooks('execute', Array) #25 /homepages/......./wire/core/admin.php(85): Wire->__call('execute', Array) #26 /homepages/......./wire/core/admin.php(85): ProcessController->execute() #27 /homepages/......./wire/modules/AdminTheme/AdminThemeDefault/controller.php(13): require('/homepages/30/d...') #28 /homepages/......./site/templates/admin.php(15): require('/homepages/30/d...') #29 /homepages/......./wire/core/TemplateFile.php(169): require('/homepages/30/d...') #30 [internal function]: TemplateFile->___render() #31 /homepages/......./wire/core/Wire.php(389): call_user_func_array(Array, Array) #32 /homepages/......./wire/core/Wire.php(344): Wire->runHooks('render', Array) #33 /homepages/......./wire/modules/PageRender.module(356): Wire->__call('render', Array) #34 /homepages/......./wire/modules/PageRender.module(356): TemplateFile->render() #35 [internal function]: PageRender->___renderPage(Object(HookEvent)) #36 /homepages/......./wire/core/Wire.php(389): call_user_func_array(Array, Array) #37 /homepages/......./wire/core/Wire.php(344): Wire->runHooks('renderPage', Array) #38 /homepages/......./wire/core/Wire.php(411): Wire->__call('renderPage', Array) #39 /homepages/......./wire/core/Wire.php(411): PageRender->renderPage(Object(HookEvent)) #40 /homepages/......./wire/core/Wire.php(344): Wire->runHooks('render', Array) #41 /homepages/......./wire/modules/Process/ProcessPageView.module(171): Wire->__call('render', Array) #42 /homepages/......./wire/modules/Process/ProcessPageView.module(171): Page->render() #43 [internal function]: ProcessPageView->___execute(true) #44 /homepages/......./wire/core/Wire.php(389): call_user_func_array(Array, Array) #45 /homepages/......./wire/core/Wire.php(344): Wire->runHooks('execute', Array) #46 /homepages/......./index.php(214): Wire->__call('execute', Array) #47 /homepages/......./index.php(214): ProcessPageView->execute(true) #48 {main}</pre> After manually removing ProcessRedirects from the server and trying to uninstall it again: Warning: class_implements(): Class ProcessRedirects does not exist and could not be loaded in /homepages/......./wire/modules/Process/ProcessModule/ProcessModule.module on line 1093Warning: in_array() expects parameter 2 to be array, boolean given in /homepages/......./wire/modules/Process/ProcessModule/ProcessModule.module on line 1093 After this and when trying to install the module again there is no error message but there is also no ProcessRedirects installed: Recently Found and Installed Modules:Within the last dayNo modules found. Link to comment Share on other sites More sharing options...
apeisa Posted November 25, 2014 Author Share Posted November 25, 2014 For some reason the install routine has failed to create the page, and uninstall fails to delete the page that doesn't exists. Not sure why it fails in first place, but there are probably lot that can be tweaked at the install routine (code is little old already). Link to comment Share on other sites More sharing options...
MartinN Posted November 25, 2014 Share Posted November 25, 2014 That doesn't matter! With the help of ExportSiteProfile I made a clean re-installation and now Redirects fires on all cylinders again :-) Thanks a lot for this great module!!! Link to comment Share on other sites More sharing options...
benbyf Posted December 5, 2014 Share Posted December 5, 2014 is there anyway for redircting everything in a folder to another with this module? i.e /test/somethinghere to /another/somethinghere Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now