renobird Posted January 5, 2015 Share Posted January 5, 2015 Tom: Regarding Legacy Domains, do you think it may come in handy if we were to add per-redirect exceptions? Perhaps you want to keep a URL on your legacy domain, but if its accessed on the new site, you don't want to redirect to legacy. Yes? Hmm. If the URL on the new site resolved to an actual page, then the redirect shouldn't get triggered — correct? So if you have: newsite.com/products/ (actual PW page) oldsite.com/products/ Then you could only get to oldsite.com/products/ by directly accessing that URL. I think this is the current behavior of the redirects module. All that said, I might be misunderstanding your question. Link to comment Share on other sites More sharing options...
Mike Rockett Posted January 5, 2015 Share Posted January 5, 2015 Ah, right! My brain has been very much turned off... (When I asked the question, I had a scenario in mind - whether or not this impacts it is now lost in the wind. If it hits me again, I'll mention it.) Link to comment Share on other sites More sharing options...
hwmaier Posted January 19, 2015 Share Posted January 19, 2015 Hi all, I am just curious about a weird style sheet insertion issue with ProcessRedirects and AIOM I came across. Maybe somebody can shed some light on this. I upgraded to version 1.0.1 published by renobird. I am also using AIOM and found that when using AIOM in development mode (only then) a style sheet /site/modules/ProcessRedirects/ProcessRedirects.css?v=101 is added to the $config->styles array which then fails to load as absolute paths are not [yet] supported by AIOM. I also saw that ProcessRedirects version 1.0.1 has renamed the style sheet to ProcessRedirects2.css and once I remove ProcessRedirects.css from the /site/modules/ProcessRedirects directory, the style sheet is not added to the array any more. Is this a known thing? And is this issue the reason why the style sheet was renamed from ProcessRedirects.css to ProcessRedirects2.css? Link to comment Share on other sites More sharing options...
creativejay Posted February 27, 2015 Share Posted February 27, 2015 I installed ProcessRedirects from the module library into my 2.5.3 install yesterday. This morning, after getting the answer to my .html/.xml question, I tried to set up a few redirects. I'm finding that any Page whose URL ends in .html is getting / tacked onto the end after Page selection, and then the URL is considered invalid and fails to save (though quietly, it seems). I've tried changing the individual pages' URLs after I select the page and save the redirect, but when I go back I get an error message. In this thread, this appears to have been corrected long ago. My ProcessRedirects config page shows it's versions 1.0.0, and declares it is up to date. I see other versions in this thread, though. So.. 1 - Shouldn't my problem not be an issue even in 1.0.0, and how can I fix it? 2 - Should I update to the latest version in this thread (looks like Dec 2014)? Is it stable for use in live sites? Thanks! Link to comment Share on other sites More sharing options...
renobird Posted February 27, 2015 Share Posted February 27, 2015 Did you turn off the trailing slashes for those templates? Link to comment Share on other sites More sharing options...
arjen Posted February 27, 2015 Share Posted February 27, 2015 Hi all, I am just curious about a weird style sheet insertion issue with ProcessRedirects and AIOM I came across. Maybe somebody can shed some light on this. I upgraded to version 1.0.1 published by renobird. I am also using AIOM and found that when using AIOM in development mode (only then) a style sheet /site/modules/ProcessRedirects/ProcessRedirects.css?v=101 is added to the $config->styles array which then fails to load as absolute paths are not [yet] supported by AIOM. I also saw that ProcessRedirects version 1.0.1 has renamed the style sheet to ProcessRedirects2.css and once I remove ProcessRedirects.css from the /site/modules/ProcessRedirects directory, the style sheet is not added to the array any more. Is this a known thing? And is this issue the reason why the style sheet was renamed from ProcessRedirects.css to ProcessRedirects2.css? I could explain why you shouldn't use $config->styles array, but soma did a great job already. Link to comment Share on other sites More sharing options...
creativejay Posted February 27, 2015 Share Posted February 27, 2015 (edited) Did you turn off the trailing slashes for those templates? Yes. I did just notice saving a page generates the message "Saved Page: /markets/industrial-automation.html/" even though I have triple-checked the template and there are no trailing slashes. Edited to Add: So is there some inherent instinct in PWire to add that trailing slash, beyond what's defined in the Settings of each page and the URL behavior of the Template? Edited February 27, 2015 by creativejay Link to comment Share on other sites More sharing options...
Mike Rockett Posted February 27, 2015 Share Posted February 27, 2015 (edited) Yes. I did just notice saving a page generates the message "Saved Page: /markets/industrial-automation.html/" even though I have triple-checked the template and there are no trailing slashes. Edited to Add: So is there some inherent instinct in PWire to add that trailing slash, beyond what's defined in the Settings of each page and the URL behavior of the Template? Confirmed - that's happening to me too. I always turn off slashes, but they show in notifications. I haven't looked, but it must be hard-coded into the notification string, whereby it doesn't check to see what the template's setting is. Edit: Appears I'm wrong. Line 259 of ProcessPageEdit.module (v2.5.20) shows: $message = sprintf($this->_('Saved Page: %s'), $this->page->path) . $numChanges; Perhaps $this->page->path is not being updated according to the template setting? Edited February 27, 2015 by Mike Anthony Link to comment Share on other sites More sharing options...
marc1n Posted March 31, 2015 Share Posted March 31, 2015 I seems that module dosn't work for urls (redirect-from) with UTF-8 characters. This change (adding "urldecode") in file ProcessRedirect.module fixed my problem: public function checkRedirects($event) { $url = urldecode($_SERVER['REQUEST_URI']); 1 Link to comment Share on other sites More sharing options...
renobird Posted March 31, 2015 Share Posted March 31, 2015 Hi marc1n, Welcome to the forums. I highly recommend looking at Jumplinks. Mike Anthony took this module and fed it some steroids. 1 Link to comment Share on other sites More sharing options...
marc1n Posted March 31, 2015 Share Posted March 31, 2015 Thanks renobird, I tried Jumplinks, but it has his own problems (import save all destinations as URLs, not page ids; it generates some php warnings etc.). I've returned to ProcessRedirects because these problems and because I need simple URL mapping. I found another problem with ProcessRedirects: it does not found hidden or unpublished destination pages. I've modified below code in order to work with hidden or unpublished pages (I've added "include=all" selector): private function _saveRedirect($from, $to, $id = 0) { $from = $this->_addUrlSlashes($from); $to = $this->sanitizer->url($to); // Not external url, if it starts with slash if(substr($to, 0, 1) == "/") { // if the redirect_to maps to a page, then store it's ID instead if(($page = $this->pages->get("$to, include=all")) && $page->id) $to = '^' . $page->id; } Link to comment Share on other sites More sharing options...
renobird Posted March 31, 2015 Share Posted March 31, 2015 I can see why you would want to return hidden pages, as they are still viewable even if excluded from lists and searches. Not including unpublished pages seems like the desired behavior. Maybe I'm missing something, but why would you want to redirect to an unpublished page? It should return a 404. Link to comment Share on other sites More sharing options...
Mike Rockett Posted April 1, 2015 Share Posted April 1, 2015 I tried Jumplinks, but it has his own problems (import save all destinations as URLs, not page ids; it generates some php warnings etc.). Hi marc1n, I'm not sure what you mean by that... Where are you importing data from? And what warnings are you getting? Edit: An import will only save page IDs if you're importing from ProcessRedirects. If you're importing from CSV, then it won't. Perhaps I should add that functionality in? So if a destination URI matches an existing page, we should set it to use the ID instead... Is that what you're referring to? 2 Link to comment Share on other sites More sharing options...
renobird Posted April 1, 2015 Share Posted April 1, 2015 if a destination URI matches an existing page, we should set it to use the ID instead +1 1 Link to comment Share on other sites More sharing options...
Mike Rockett Posted April 1, 2015 Share Posted April 1, 2015 Cool, I'll set that up as soon as I can. Still trying to recover from this. Link to comment Share on other sites More sharing options...
marc1n Posted April 1, 2015 Share Posted April 1, 2015 I'm not sure what you mean by that... Where are you importing data from? And what warnings are you getting? Edit: An import will only save page IDs if you're importing from ProcessRedirects. If you're importing from CSV, then it won't. Perhaps I should add that functionality in? So if a destination URI matches an existing page, we should set it to use the ID instead... Is that what you're referring to? I was importing from CVS. The lack of this functionality is the reason I returned to ProcessRedirects module. I don't remember text of warnings, sorry. Link to comment Share on other sites More sharing options...
marc1n Posted April 1, 2015 Share Posted April 1, 2015 I can see why you would want to return hidden pages, as they are still viewable even if excluded from lists and searches. Not including unpublished pages seems like the desired behavior. Maybe I'm missing something, but why would you want to redirect to an unpublished page? It should return a 404. My use case is such that I have unpublished pages. I am importing URL mapping from CSV. I want that import matches old URLs with these unpublished pages ID's, because perhaps I will change name of these pages before I will publish them. Link to comment Share on other sites More sharing options...
Mike Rockett Posted April 1, 2015 Share Posted April 1, 2015 I see that I actually did implement the feature, but it checks by name, which won't always work. Redirects uses this: if(($page = $this->pages->get($to)) && $page->id) $to = '^' . $page->id; Jumplinks uses this: if (($page = $this->pages->get('name=' . trim($input->destinationUriUrl, '/'))) && $page->id) { $input->destinationUriUrl = "page:{$page->id}"; } I'll fix this asap. Link to comment Share on other sites More sharing options...
Mike Rockett Posted April 1, 2015 Share Posted April 1, 2015 Fixed - see commit. If you see any errors, please do jot them down and mention them in Jumplinks support thread. Thanks. Link to comment Share on other sites More sharing options...
uiui Posted June 18, 2015 Share Posted June 18, 2015 Did anyone ever experience issues with the Autodetect Language module and redirections? The Autodetect Language module only kicks in when the user is not reidentified and unfortunately, when this is the case, my redirected urls lead to 404 errors. Link to comment Share on other sites More sharing options...
quickjeff Posted August 19, 2015 Share Posted August 19, 2015 So just to be sure, this is actually producing a 301 right? Just making sure for SEO reasons. WE have about 300 301 redirects we are going to process for a site redesign we did. Link to comment Share on other sites More sharing options...
Mike Rockett Posted August 19, 2015 Share Posted August 19, 2015 So just to be sure, this is actually producing a 301 right? Just making sure for SEO reasons. WE have about 300 301 redirects we are going to process for a site redesign we did. Yup. Module uses $session->redirect(). Link to comment Share on other sites More sharing options...
quickjeff Posted August 19, 2015 Share Posted August 19, 2015 @mike Sold! Thanks man. Link to comment Share on other sites More sharing options...
Mike Rockett Posted August 20, 2015 Share Posted August 20, 2015 @mike Sold! Thanks man. Any time. Side note: That's quite a lot of redirects - perhaps you might want to give Jumplinks (links in signature) a try. It has wildcard support, which will, more than likely, reduce the amount of redirects needed... Link to comment Share on other sites More sharing options...
quickjeff Posted August 20, 2015 Share Posted August 20, 2015 Any time. Side note: That's quite a lot of redirects - perhaps you might want to give Jumplinks (links in signature) a try. It has wildcard support, which will, more than likely, reduce the amount of redirects needed... But does jump links support 301? We need to pass SEO value to the new pages. 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