Can I use the No duplicate without activating URL rewriting?

Discussions and support about the different URL Rewriting techniques for phpBB.

Moderator: Moderators

Can I use the No duplicate without activating URL rewriting?

Postby phpbbjapan » Wed Jul 31, 2013 7:57 am

Hi. I installed phpBB SEO.

My settings are as follows.

Activate URL rewriting: No
Activate The No duplicate: Yes
Activate the Zero duplicate: No
Strict Mode: Yes

Because I do not activate URL rewriting, I cannot activate the Zero duplicate, still hoping the No duplicate will prevent any page from having many links.

But, even after saving the .htaccess, duplicate links are produced. For example, the very same page has the following 4 different links.

viewtopic.php?f=10&t=26&start=0#p33
viewtopic.php?f=10&t=26#p33
viewtopic.php?f=10&p=33#p33
viewtopic.php?t=26#p33

Doesn't the No duplicate work when I do not activate URL rewriting?
phpbbjapan
 
Posts: 4
Joined: Tue Jul 30, 2013 6:47 pm

Advertisement

Can I use the No duplicate without activating URL rewriting?

Postby phpbbjapan » Wed Jul 31, 2013 9:48 pm

Google Webmaster Tools complain that there are pages with duplicate title tags in my phpBB site. In fact clicking the links to the same page in different places of the site produces the following different URLs.

1. Clicking the "last post" link of the index.php produces

viewtopic.php?f=35&p=23#p23

2. Clicking the "last post" link of the forum page produces

viewtopic.php?f=35&t=8&start=0#p23

3. Clicking the title of the page produces

viewtopic.php?f=35&t=8#p23

phpBB-SEO without activating URL rewriting seems to unify them into the third one. Is there any technique to redirect the first two to the third one?
phpbbjapan
 
Posts: 4
Joined: Tue Jul 30, 2013 6:47 pm

Re: Can I use the No duplicate without activating URL rewrit

Postby phpbbjapan » Wed Jul 31, 2013 10:03 pm

I tried setting "Activate URL rewriting:" option to Yes. Then I can set "Activate the Zero duplicate:" to Yes. After saving the .htaccess file I accessed my phpBB site to get the following error message.

Code: Select all
General Error
Tried to redirect to potentially insecure url.

BACKTRACE

FILE: (not given by php)
LINE: (not given by php)
CALL: msg_handler()

FILE: [ROOT]/phpbb_seo/includes/setup_phpbb_seo.php
LINE: 150
CALL: trigger_error()

FILE: [ROOT]/phpbb_seo/includes/setup_phpbb_seo.php
LINE: 220
CALL: setup_phpbb_seo->seo_redirect()

FILE: [ROOT]/index.php
LINE: 44
CALL: setup_phpbb_seo->seo_chk_dupe()


What's wrong with me?
phpbbjapan
 
Posts: 4
Joined: Tue Jul 30, 2013 6:47 pm

Re: Can I use the No duplicate without activating URL rewrit

Postby HB » Thu Aug 01, 2013 2:30 pm

Not sure. I would try adding some more information to the error message below (e.g., what is the URL it's trying to redirect). From setup_phpbb_seo.php:

Code: Select all
   function seo_redirect($url, $header = '301 Moved Permanently', $code = 301, $replace = true) {
      global $db;
      if (!$this->seo_opt['zero_dupe']['on'] || @headers_sent()) {
         return false;
      }
      garbage_collection();
      $url = str_replace('&', '&', $url);
      // Behave as redirect() for checks to provide with the same level of protection
      // Make sure no linebreaks are there... to prevent http response splitting for PHP < 4.4.2
      if (strpos(urldecode($url), "\n") !== false || strpos(urldecode($url), "\r") !== false || strpos($url, ';') !== false) {
         trigger_error('Tried to redirect to potentially insecure url.', E_USER_ERROR);
      }
      // Now, also check the protocol and for a valid url the last time...
      $allowed_protocols = array('http', 'https'/*, 'ftp', 'ftps'*/);
      $url_parts = parse_url($url);
      if ($url_parts === false || empty($url_parts['scheme']) || !in_array($url_parts['scheme'], $allowed_protocols)) {
         trigger_error('Tried to redirect to potentially insecure url.', E_USER_ERROR);
      }
      $http = 'HTTP/1.1 ';
      header($http . $header, $replace, $code);
      header('Cache-Control: no-store, no-cache, must-revalidate');
      header('Pragma: no-cache');
      header('Expires: -1');
      header('Location: ' . $url);
      exit_handler();
   }
Dan Kehn
HB
phpBB SEO Team
phpBB SEO Team
 
Posts: 1516
Joined: Mon Oct 16, 2006 2:25 am

Re: Can I use the No duplicate without activating URL rewrit

Postby phpbbjapan » Sat Aug 03, 2013 4:22 am

Thank you for response, Dan Kehn.

But I don't know what to do with you info. I reinstalled phpBB SEO premod and it seems better than before.

The bottom line of this topic is that the No duplicate is not an independent function and I cannot use it without activating URL rewriting. Is it right?
phpbbjapan
 
Posts: 4
Joined: Tue Jul 30, 2013 6:47 pm


Return to phpBB mod Rewrite

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 6 guests