Title: [Plugin: User Access Manager] Custom permalinks breaks redirect
Last modified: August 19, 2016

---

# [Plugin: User Access Manager] Custom permalinks breaks redirect

 *  [miccet](https://wordpress.org/support/users/miccet/)
 * (@miccet)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/plugin-user-access-manager-custom-permalinks-breaks-redirect/)
 * Hi there!
 * Fist off, thanks to the creator of this plugin. It’s helped me a lot in my current
   project. The problem I have though is that if I set the permalinks to a custom
   format the redirecting stops working. Looking at the code of the plugin this 
   might be a known limitation as it looks for the cat_id and page_id parameters
   on the request. Is this the case and will custom permalinks be supported in the
   future?
 * Thanks

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [marlus](https://wordpress.org/support/users/marlus/)
 * (@marlus)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/plugin-user-access-manager-custom-permalinks-breaks-redirect/#post-1742497)
 * Hello miccet,
 * I found what looks like to be a fix (already submitted to alex) but you might
   rush and try for yourself.
 * add this code:
 *     ```
       } elseif (isset($pageParams->query_vars['pagename'])) {
                   	$postId = url_to_postid($pageParams->query_vars['pagename']);
                   	$object = get_post($postId);
                       $objectType = $object->post_type;
                       $objectId = $object->ID;
                   }
       ```
   
 * as another elseif of the block you said in your post.
 * file:
    user-access-manager/class/UserAccessManager.class.php function: public
   function redirect($headers, $pageParams)
 * near line 1977 (another else if block there)
 * Regards
 *  Thread Starter [miccet](https://wordpress.org/support/users/miccet/)
 * (@miccet)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/plugin-user-access-manager-custom-permalinks-breaks-redirect/#post-1742498)
 * Hi marlus,
 * Thanks for looking into the issue. I put in the code in the right place but it’s
   still not redirecting to the page I specified in the settings of UAM. When I 
   put it back to ‘default’ permalinks it works again. I think I’m gonna have to
   use a debugger to see what’s really going on in there. I will keep following 
   the thread and post whatever I find.
 * Cheers
 *  [julien_vc](https://wordpress.org/support/users/julien_vc/)
 * (@julien_vc)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/plugin-user-access-manager-custom-permalinks-breaks-redirect/#post-1742500)
 * Hi Miccet and Marlus
 * I like that plugin and already installed it on several websites, so thank you
   for this!
    But I have the same type of problem: When I set the plugin to redirect
   to a specific page of the website, it doesn’t work. Hopefully I didn’t do anything
   wrong and the problem is somewhere else…
 * In advance thank you for your help on that one
 *  [orbital](https://wordpress.org/support/users/orbital/)
 * (@orbital)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/plugin-user-access-manager-custom-permalinks-breaks-redirect/#post-1742505)
 * Just a quick heads up that the code Marlus provided fixed this problem for me.
   Good work Marlus, and thanks!
 *  [thoughton](https://wordpress.org/support/users/thoughton/)
 * (@thoughton)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-user-access-manager-custom-permalinks-breaks-redirect/#post-1742511)
 * Unfortunately I seem to be having the same problem as Miccet – UAM won’t redirect
   to the page specified in the UAM settings. I have added Marlus’s code snippet
   to the ‘public function redirect’ on line 1977 but the behaviour hasn’t changed.
   🙁
 * The new code looks like this, which seems correct to me?
 * _[Code moderated as per the [Forum Rules](http://codex.wordpress.org/Forum_Welcome).
   Please use the [pastebin](http://wordpress.pastebin.com/)]_
 *  [thoughton](https://wordpress.org/support/users/thoughton/)
 * (@thoughton)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-user-access-manager-custom-permalinks-breaks-redirect/#post-1742512)
 * Okay here’s a second attempt at the code! 🙂
 * [http://pastebin.com/hE4p8qcL](http://pastebin.com/hE4p8qcL)

Viewing 6 replies - 1 through 6 (of 6 total)

 The topic ‘[Plugin: User Access Manager] Custom permalinks breaks redirect’ is 
closed to new replies.

 * ![](https://ps.w.org/user-access-manager/assets/icon.svg?rev=1563783)
 * [User Access Manager](https://wordpress.org/plugins/user-access-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/user-access-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/user-access-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/user-access-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/user-access-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/user-access-manager/reviews/)

 * 6 replies
 * 5 participants
 * Last reply from: [thoughton](https://wordpress.org/support/users/thoughton/)
 * Last activity: [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-user-access-manager-custom-permalinks-breaks-redirect/#post-1742512)
 * Status: not resolved