Title: Comments Redirect doesn&#039;t work
Last modified: August 20, 2016

---

# Comments Redirect doesn't work

 *  Resolved [coris](https://wordpress.org/support/users/coris/)
 * (@coris)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/comments-redirect-doesnt-work/)
 * I’ve installed the plugin into my website, and it still redirect to default language.
   What can I do to fix it?
 * [http://www.lt-light.com/website](http://www.lt-light.com/website)
 * [http://wordpress.org/extend/plugins/qtranslate-separate-comments/](http://wordpress.org/extend/plugins/qtranslate-separate-comments/)

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/comments-redirect-doesnt-work/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/comments-redirect-doesnt-work/page/2/?output_format=md)

 *  Plugin Author [Nikola Nikolov](https://wordpress.org/support/users/nikolovtmw/)
 * (@nikolovtmw)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/comments-redirect-doesnt-work/#post-3155330)
 * Sorry for answering after so much time – I don’t get emails when new support 
   topics are opened and I haven’t looked here for a long time 🙂
 * Any way, I registered for your site and I’m waiting for the email right now, 
   so that I can take a look at your comments form.
 * I guess though that the hidden inputs that I add in order to get the proper language
   and redirection are not added to your comments form.
 *  Thread Starter [coris](https://wordpress.org/support/users/coris/)
 * (@coris)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/comments-redirect-doesnt-work/#post-3155331)
 * I’ve already figured out several weeks ago. Everything works fine now. Thanks
   anyway for your plugin 🙂
 *  Plugin Author [Nikola Nikolov](https://wordpress.org/support/users/nikolovtmw/)
 * (@nikolovtmw)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/comments-redirect-doesnt-work/#post-3155332)
 * Was that the problem or was it something else?
 *  Thread Starter [coris](https://wordpress.org/support/users/coris/)
 * (@coris)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/comments-redirect-doesnt-work/#post-3155333)
 * Yeah, was that 😉
 *  [a.s.panchenko](https://wordpress.org/support/users/aspanchenko/)
 * (@aspanchenko)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/comments-redirect-doesnt-work/#post-3155343)
 * Hi
    There is a bug with redirection. If we have a `/land/` type of url-modification,
   redirection always works to main language page.
 * Exp.
    `mysite.com/fr/contact` will redirect to `mysite.com/contact`
 * I’ve looked for and find that there is a hidden input, but it has wrong value
   like this `/contact` (should `/fr/contact`).
 * Anyway, thanks for your plugin. If you have solution let me know.
 *  Plugin Author [Nikola Nikolov](https://wordpress.org/support/users/nikolovtmw/)
 * (@nikolovtmw)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/comments-redirect-doesnt-work/#post-3155344)
 * Hi, can you try to change this code in `qtranslate-separate-comments.php`:
 * `return $pageURL;`
 * with:
 * `return qtrans_convertURL();`
 * And tell me if it works,
    thanks 🙂
 *  [a.s.panchenko](https://wordpress.org/support/users/aspanchenko/)
 * (@aspanchenko)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/comments-redirect-doesnt-work/#post-3155345)
 * No, it doesn’t ))
    Redirection still goes to main lang. Comment leaved on additional
   language page marked as a main lang (it was before this fix too).
 * But now hidden input looks like:
    `<input type="hidden" value="http://mysite.
   com/fr/contact/" name="qtc_comment_from">`
 * Before this fix it looked like:
    `<input type="hidden" value="/contact" name="
   qtc_comment_from">`
 * If manualy change (with firebug for exp.) it to `/fr/contact` everything works
   fine (`<input type="hidden" value="/fr/contact" name="qtc_comment_from">`).
 *  Plugin Author [Nikola Nikolov](https://wordpress.org/support/users/nikolovtmw/)
 * (@nikolovtmw)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/comments-redirect-doesnt-work/#post-3155346)
 * What if you do this:
 * `return preg_replace( '~' . preg_quote( home_url( '' ), '~' ) . '~', '', qtrans_convertURL());`
 * I’m sorry for making you test things out like that, but I have too much work 
   right now to test this myself 🙂
 *  [a.s.panchenko](https://wordpress.org/support/users/aspanchenko/)
 * (@aspanchenko)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/comments-redirect-doesnt-work/#post-3155347)
 * Yes, this hack works fine now ))
 * Thanks for help.
 *  Plugin Author [Nikola Nikolov](https://wordpress.org/support/users/nikolovtmw/)
 * (@nikolovtmw)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/comments-redirect-doesnt-work/#post-3155348)
 * Glad it works 🙂
 * I’ll put this into an update really soon.
 *  [mikewinsc](https://wordpress.org/support/users/mikewinsc/)
 * (@mikewinsc)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/comments-redirect-doesnt-work/#post-3155350)
 * Nikolov,
 * I tried your hack above but it didn’t work on my dev site. Is there anything 
   I am doing wrong here?
 * My dev site: [http://www.196flavors.com/dev](http://www.196flavors.com/dev)
 * The comment gets posted in default language and user is redirected to post in
   English (default language)
 * Thanks for your help. This would be a great plugin if it worked on our site.
 * Michael
 *  Plugin Author [Nikola Nikolov](https://wordpress.org/support/users/nikolovtmw/)
 * (@nikolovtmw)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/comments-redirect-doesnt-work/#post-3155351)
 * Hi, it seems that you’re missing the `comment_form` action hook in your custom
   comments form.
 * See this entry from the “FAQ” of the plugin:
 * **The plugin doesn’t redirect to the proper language and the language is set 
   incorrectly**
    In order to properly identify where the comment is coming from,
   this plugin adds a hidden input to the Comments form. This is done by hooking
   a function to the `comment_form` action hook, which is called from the `comment_form()`
   WordPress function. If you are using a custom comments form instead of calling
   this function, make sure to add `<?php do_action( 'comment_form', $post->ID );?
   >`. If this still doesn’t work, replace that code with the following: `<?php 
   global $post; do_action( 'comment_form', $post->ID ); ?>`.
 * ================================
 * Adding the above should solve your issue.
 *  [mikewinsc](https://wordpress.org/support/users/mikewinsc/)
 * (@mikewinsc)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/comments-redirect-doesnt-work/#post-3155352)
 * Thanks Nikolov but I am not sure where to place this code.
 * For info, I was using the standard comments before yesterday and it still didn’t
   work. I installed Jetpack comments (right before I posted my question) and that
   is what you tested and why you made a reference to a custom comments form.
 * Could you help me understand where to place this code:
    1. For the standard comment
   form 2. For Jetpack (if possible)
 * FYI, I just reverted back to the standard comments form by deactivating Jetpack
 *  Plugin Author [Nikola Nikolov](https://wordpress.org/support/users/nikolovtmw/)
 * (@nikolovtmw)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/comments-redirect-doesnt-work/#post-3155353)
 * Can you mail me at [my username]@gmail.com ?
 *  [Webprom Design](https://wordpress.org/support/users/webprom/)
 * (@webprom)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/comments-redirect-doesnt-work/#post-3155355)
 * `return preg_replace( '~' . preg_quote( home_url( '' ), '~' ) . '~', '', qtrans_convertURL());`–
   this fix worked, please remember to include in next version 🙂 thanks, great 
   plugin!

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/comments-redirect-doesnt-work/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/comments-redirect-doesnt-work/page/2/?output_format=md)

The topic ‘Comments Redirect doesn't work’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/qtranslate-separate-comments.svg)
 * [qTranslate(-X) Separate Comments](https://wordpress.org/plugins/qtranslate-separate-comments/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/qtranslate-separate-comments/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/qtranslate-separate-comments/)
 * [Active Topics](https://wordpress.org/support/plugin/qtranslate-separate-comments/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/qtranslate-separate-comments/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/qtranslate-separate-comments/reviews/)

 * 16 replies
 * 5 participants
 * Last reply from: [Nikola Nikolov](https://wordpress.org/support/users/nikolovtmw/)
 * Last activity: [13 years, 3 months ago](https://wordpress.org/support/topic/comments-redirect-doesnt-work/page/2/#post-3155356)
 * Status: resolved