This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

Clean URL's issue?
#1

Does the script have any issues with clean url's?

The comments script works fine when the url is like :
http://www.example.com/news.php?sid=100

My clean url (for the above url) looks like this :
http://www.example.com/100/the-news-title/

However, when I turn on clean URL's, all my social buttons (facebook like, tweet, google+) are now showing the share results of my main page (www.example.com) and not the specific news item like it normally does.

It's like "/100/the-news-title/" part is being internally stripped out - but the url bar still shows it.

Also, when I try to submit a comment, the url is rewritten to :
Code:
http://www.example.com/100/the-news-title/?sid=100#comments

Not sure why the comments script is adding the "?sid=100".

This is what I am using to display the form :

PHP Code:
<?php
$cmtx_page_id
= $sid;
$cmtx_reference = $title;
$cmtx_path = 'comments/';
define('IN_COMMENTICS', 'true');
require
$cmtx_path . 'includes/commentics.php';
?>

My apache rewrite (for clean urls) is :

Code:
RewriteRule ^([0-9]+)/?.*$ /news.php?sid=$1 [NC,L]

Any ideas what the issue may be?
Reply
#2

Yes, there are currently a few issues with clean URLs.

To fix the comment submit issue, try this solution:
http://www.commentics.org/forum/showthre...15#pid4115

Not sure what you mean by the social buttons are showing the share results of your main page.

The share URL, for example ..

"http://www.facebook.com/sharer.php?u=http://www.commentics.org/demo.php&t=Commentics%20Demo"

.. is obtained from the URL in Manage -> Pages. The code which builds the share URL doesn't take any notice of the URL in the address bar, whether it's a clean URL or not. It gets the URL directly from the 'pages' database table, according to the $cmtx_page_id value in the integration code.

Have you completed the interview?
Reply
#3

Thank you, that new function fixed the rewrite issues.

I do still have the social buttons issue though. I have "Comments > Social" completely disabled - but the comments script still seems to effect my custom social buttons I have added on my news page.

Each of my pages has this :

Code:
<div class="addthis_toolbox addthis_default_style" style="width:400px">
<a class="addthis_button_facebook_like" fb:like:layout="button_count" title="Like this post!"></a>
<a class="addthis_button_tweet"></a>
<a class="addthis_button_google_plusone" g:plusone:size="medium"></a>
<a class="addthis_counter addthis_pill_style"></a></div>

(That code above is from addthis.com).

What that code normally does is show how many likes / tweets http://www.example.com/100/example-news-title/ page has - but now, it is displaying how many likes / tweets http://www.example.com root main page has.

That's what I meant by the comments script seems to be still internally stripping out the /100/example-news-title/ part in the URL.

Any ideas what to try to fix this?
Reply
#4

(22-Apr-2013, 05:39 AM)MuffinMan Wrote:  However, when I turn on clean URL's, all my social buttons (facebook like, tweet, google+) are now showing the share results of my main page (www.example.com) and not the specific news item like it normally does.

So this problem only happens when you turn on clean URLs? Are you sure it's not an issue with your clean URLs and addthis.com. If you remove Commentics does the addthis.com script work?

Have you completed the interview?
Reply
#5

(22-Apr-2013, 04:30 PM)Steven Wrote:  
(22-Apr-2013, 05:39 AM)MuffinMan Wrote:  However, when I turn on clean URL's, all my social buttons (facebook like, tweet, google+) are now showing the share results of my main page (www.example.com) and not the specific news item like it normally does.

So this problem only happens when you turn on clean URLs? Are you sure it's not an issue with your clean URLs and addthis.com. If you remove Commentics does the addthis.com script work?

Yes, when I remove the commentics code, everything works as per normal again.
Reply
#6

I'm so sorry ... after using the ExamDiff program and examining my news.php and news2.php (files with and without commentics code), it appears I accidentally commented out a critical line that sets my "canonical" meta tag.

The "AddThis" share buttons reads that meta tag in order to set the share URL + display the "shares" for that URL.

Everything is working perfectly now.
Reply
#7

That's okay, glad you got it fixed.

Have you completed the interview?
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by Steven
06-Nov-2013, 07:44 PM
Last Post by zifzif
03-Jul-2012, 02:24 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)