Title: Redirect link problem
Last modified: August 20, 2016

---

# Redirect link problem

 *  [bigs38](https://wordpress.org/support/users/bigs38/)
 * (@bigs38)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/redirect-link-problem/)
 * Hello,
    I have different posts on my site with a photo, when you clic on it it
   will open an album but you need to be connected to see it. I want to use the 
   redirect function to redirect people on the right album when they login. For 
   this I use this link :
 * /wp-login.php?redirect_to=http://www.mysite.fr/gallery?g2_itemId=1234
 * But when I use class=”simplemodal-login” in my href, the end of the link, from
   the equal signe, is cutted like this: [http://www.mysite.fr/gallery?g2_itemId](http://www.mysite.fr/gallery?g2_itemId)
 * Do you have any idea ?
    Thank you
 * [http://wordpress.org/extend/plugins/simplemodal-login/](http://wordpress.org/extend/plugins/simplemodal-login/)

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

 *  [enghaug](https://wordpress.org/support/users/enghaug/)
 * (@enghaug)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/redirect-link-problem/#post-3631716)
 * You can edit this section, located in **default.js**:
 *     ```
       if (redirect.length) {
              var href = location.href;
              if (redirect.html().length) {
                  href = redirect.html();
              }
              window.location = <The location you want>
       }
       ```
   
 *  Thread Starter [bigs38](https://wordpress.org/support/users/bigs38/)
 * (@bigs38)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/redirect-link-problem/#post-3631719)
 * Thanks for the answer. But in my case the redirect link is always different. 
   I can’t write a hard link directly in the code because it depend on my posts,
   or I don’t understand what I can write in windows.location.
 * I use some regexp to change links in my posts (when you are not logged) like 
   this:
 *     ```
       http://www.mysite.com/albums?g2_itemId=1234
   
       to
   
       class="simplemodal-login" http://www.mysite.com/wp-login.php?redirect_to=http://www.mysite.com/albums?g2_itemId=1234
       ```
   
 * All seems to work when I use the plugin, the only bug is the truncated link, 
   it remove the =1234 at the end.

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

The topic ‘Redirect link problem’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/simplemodal-login.svg)
 * [SimpleModal Login](https://wordpress.org/plugins/simplemodal-login/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/simplemodal-login/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/simplemodal-login/)
 * [Active Topics](https://wordpress.org/support/plugin/simplemodal-login/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/simplemodal-login/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/simplemodal-login/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [bigs38](https://wordpress.org/support/users/bigs38/)
 * Last activity: [13 years, 1 month ago](https://wordpress.org/support/topic/redirect-link-problem/#post-3631719)
 * Status: not resolved