extra mod_rewrite with advanced seo and zero dupe

phpBB2 SEO Advanced mod Rewrite support forum.
This mods performs URL rewriting for phpBB, injecting categories, forums and topic titles in their URLs.

Moderator: Moderators

extra mod_rewrite with advanced seo and zero dupe

Postby lavinya » Wed Feb 07, 2007 6:36 pm

hello.
I using
phpBB SEO Advanced mod Rewrite 0.2.2
phpBB SEO Zero duplicate - phpBB SEO Advanced mod Rewrite version 0.2.2


How to rewrite urls?
(display link and redirect old url)


Code: Select all
profile.php?mode=register&agreed=true >>  yeni-kayit.html
profile.php?mode=register&agreed=true&coppa=true >> kayit-coppa.html
profile.php?&mode=register >> kayit.html
profile.php?mode=sendpassword >> kayipsifre.html


thanks.
User avatar
lavinya
PR1
PR1
 
Posts: 167
Joined: Mon Jul 24, 2006 9:05 am
Location: Turkey

Advertisement

Postby AmirAbbas » Thu Feb 08, 2007 5:08 am

hi lavinya

i think rewriting that URLs are not valuable
you must ban all of that URLs with robots.txt file because that links are not contain any valuable informations for indexing.

Code: Select all
User-agent: *
Disallow: /profile.php?


for example the profile.php URLs are banned here

http://www.phpbb-seo.com/boards/robots.txt

you can rewrite them but rewriting that links only waste the server resources
:roll:
User avatar
AmirAbbas
phpBB SEO Team
phpBB SEO Team
 
Posts: 534
Joined: Thu May 11, 2006 3:30 pm
Location: IRAN

Postby lavinya » Thu Feb 08, 2007 9:53 am

thanks amir abbas ok.
Last edited by lavinya on Thu Feb 08, 2007 11:33 am, edited 1 time in total.
User avatar
lavinya
PR1
PR1
 
Posts: 167
Joined: Mon Jul 24, 2006 9:05 am
Location: Turkey

Postby dcz » Thu Feb 08, 2007 10:30 am

If you really want though, it's very possible.

Amir is right these are not SEO valuable, but, if you where previously using them ...

So please tell me what would you like to do.

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21411
Joined: Fri Apr 28, 2006 9:03 pm

Postby MorYeL » Thu Feb 08, 2007 11:48 am

Hi to all... Dcz, lavinya said that ;

I am using able2know now. url seems
Code: Select all
profile.php?mode=register&agreed=true
but I want it be to
Code: Select all
yeni-kayit.html


And the others are should be:

Code: Select all
profile.php?mode=register&agreed=true&coppa=true
to
Code: Select all
kayit-coppa.html

Code: Select all
profile.php?&mode=register
to
Code: Select all
kayit.html
Code: Select all
profile.php?mode=sendpassword
to
Code: Select all
kayipsifre.html


How can we do this...

He said ;)
MorYeL
PR0
PR0
 
Posts: 99
Joined: Fri Aug 11, 2006 12:13 pm

Postby dcz » Thu Feb 08, 2007 11:54 am

This I know ;)

So please tell me what would you like to do.


;)
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21411
Joined: Fri Apr 28, 2006 9:03 pm

Postby lavinya » Thu Feb 08, 2007 11:57 am

dcz example forum:
www.lavinya.net/phpBB2/

but register url(üye ol): http://www.lavinya.net/phpBB2/kayit.html
and other above link.

i this week migrate to
phpBB SEO Advanced mod Rewrite 0.2.2
phpBB SEO Zero duplicate - phpBB SEO Advanced mod Rewrite version 0.2.2
User avatar
lavinya
PR1
PR1
 
Posts: 167
Joined: Mon Jul 24, 2006 9:05 am
Location: Turkey

Postby MorYeL » Thu Feb 08, 2007 12:03 pm

MorYeL wrote:Hi to all... Dcz, lavinya said that ;

I am using able2know now. url seems
Code: Select all
profile.php?mode=register&agreed=true
but I want it be to
Code: Select all
yeni-kayit.html


And the others are should be:

Code: Select all
profile.php?mode=register&agreed=true&coppa=true
to
Code: Select all
kayit-coppa.html

Code: Select all
profile.php?&mode=register
to
Code: Select all
kayit.html
Code: Select all
profile.php?mode=sendpassword
to
Code: Select all
kayipsifre.html


How can we do this...

He said ;)


We want to migrate this to phpBB SEO Advanced mod Rewrite 0.2.2
phpBB SEO Zero duplicate - phpBB SEO Advanced mod Rewrite version 0.2.2
MorYeL
PR0
PR0
 
Posts: 99
Joined: Fri Aug 11, 2006 12:13 pm

Postby dcz » Thu Feb 08, 2007 12:40 pm

All right ;)

Open :

Code: Select all
phpbb_seo/phpbb_seo_class.php


Find :

Code: Select all
   function profile() {
      if ( !empty($this->get_vars[POST_USERS_URL]) && $this->get_vars['mode'] === 'viewprofile') {
         $this->url =  $this->seo_static['user'] . $this->get_vars[POST_USERS_URL] . $this->seo_ext['user'];
         unset($this->get_vars[POST_USERS_URL]);
         unset($this->get_vars['mode']);
      }
      return;
   }


Replace with :

Code: Select all
   function profile() {
      if ( !empty($this->get_vars[POST_USERS_URL]) && $this->get_vars['mode'] === 'viewprofile') {
         $this->url =  $this->seo_static['user'] . $this->get_vars[POST_USERS_URL] . $this->seo_ext['user'];
         unset($this->get_vars[POST_USERS_URL]);
         unset($this->get_vars['mode']);
         return;
      } elseif ($this->get_vars['mode'] === 'register' ) {
         if ($this->get_vars['agreed'] === 'true' && $this->get_vars['coppa'] === 'true' ) {
            $this->url =  'kayit-coppa.html';
            unset($this->get_vars['agreed']);
            unset($this->get_vars['coppa']);
         } else {
            $this->url =  'kayit.html';
         }
         unset($this->get_vars['mode']);
         return;
      } elseif ($this->get_vars['mode'] === 'sendpassword' ) {
         $this->url =  'kayipsifre.html';
         unset($this->get_vars['mode']);
      }
      return;
   }


Should do it ;)

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21411
Joined: Fri Apr 28, 2006 9:03 pm

Postby lavinya » Thu Feb 08, 2007 12:41 pm

:shock: Million thanks admin :)

ok. works.
Last edited by lavinya on Thu Feb 08, 2007 3:56 pm, edited 1 time in total.
User avatar
lavinya
PR1
PR1
 
Posts: 167
Joined: Mon Jul 24, 2006 9:05 am
Location: Turkey

Postby MorYeL » Thu Feb 08, 2007 3:34 pm

We have migrated it to advanced seo and zero duplucate... When we login from able2know there is 404 error...!!! And the address is seeming like
Code: Select all
http://www.lavinya.net/phpBB2/http://www.lavinya.net/phpBB2/?sid=516dd146a190e4d5d409c433f95bdda0
...

And admin page's url is :

Code: Select all
http://www.lavinya.net/phpBB2/admin/http://www.lavinya.net/phpBB2/?admin=1&sid=47294baef2741e24c3df5119dde5e9cd
MorYeL
PR0
PR0
 
Posts: 99
Joined: Fri Aug 11, 2006 12:13 pm

Postby MorYeL » Thu Feb 08, 2007 4:26 pm

approve mod was like viewtopic.php?p=47956&app_p=48911#48911 but it is like şimdi post48911.html?app_p=48911#48911 and when click it, it doesn't working. http://www.phpbb.com/phpBB/viewtopic.php?p=2183442 I installed this mode... http://www.phpbb.com/phpBB/viewtopic.php?p=2183442

And I will install http://www.phpbb.com/phpBB/viewtopic.php?t=444640 this mod in the future...
MorYeL
PR0
PR0
 
Posts: 99
Joined: Fri Aug 11, 2006 12:13 pm

Postby dcz » Thu Feb 08, 2007 4:30 pm

As the zero dupe is up and running : http://www.lavinya.net/phpBB2/very-big-dupe-f2.html

My bet is you put a R=301 flag in the able2know rewriterules and you should not.

Could you start another topic if you need more support on this, and post you .htaccess if needed ?

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21411
Joined: Fri Apr 28, 2006 9:03 pm

Postby MorYeL » Thu Feb 08, 2007 4:46 pm

The .htaccess is:

Code: Select all
RewriteEngine On
RewriteBase /phpBB2/

#########################################################
# PHPBB SEO REWRITE RULES            #
#########################################################
# AUTHOR : dcz http://www.phpbb-seo.com/
# STARTED : 01/2006
#####################################################
# FORUMS PAGES
########################
# FORUM INDEX (un-comment if used)
# RewriteRule ^index\.html$ index.php [QSA,L]
# FORUM PROTECTION RULE
#RewriteRule ^.+/([^/]+\.html)$ index.php [R=301,L]
# CATEGORIES
RewriteRule ^.*-c([0-9]+)\.html$ index.php?c=$1 [QSA,L]
# PAGINATED FORUM
RewriteRule ^.*-f([0-9]+)-([0-9]+)\.html$ viewforum.php?f=$1&start=$2 [QSA,L]
# FORUM
RewriteRule ^.*-f([0-9]+)\.html$ viewforum.php?f=$1 [QSA,L]
# PAGINATED TOPIC
RewriteRule ^.*-t([0-9]+)-([0-9]+)\.html$ viewtopic.php?t=$1&start=$2 [QSA,L]
# TOPIC
RewriteRule ^.*-t([0-9]+)\.html$ viewtopic.php?t=$1 [QSA,L]
# POST
RewriteRule ^post([0-9]+)\.html$ viewtopic.php?p=$1 [QSA,L]
#PROFILES
RewriteRule ^uye-([0-9]+)\.html$ profile.php?mode=viewprofile&u=$1 [QSA,L]
# END PHPBB PAGES
#####################################################
RewriteRule ^post-([0-9]*)\.html viewtopic.php?p=$1 [L,NC]
RewriteRule ^view-poll([0-9]*)-([0-9]*)-([a-zA-Z]*).* viewtopic.php?t=$1&postdays=$2&postorder=$3&vote=viewresult [L,NC]
RewriteRule ^about([0-9]*).html&highlight=([a-zA-Z0-9]*) viewtopic.php?t=$1&highlight=$2 [L,NC]
RewriteRule ^about([0-9]*).html&view=newest viewtopic.php?t=$1&view=newest [L,NC]
RewriteRule ^about([0-9]*)-([0-9]*)-([a-zA-Z]*)-([0-9]*).* viewtopic.php?t=$1&postdays=$2&postorder=$3&start=$4 [L,NC]
RewriteRule ^about([0-9]*)-([0-9]*).* viewtopic.php?t=$1&start=$2 [L,NC]
RewriteRule ^about([0-9]*).* viewtopic.php?t=$1 [L,NC]
RewriteRule ^about([0-9]*).html viewtopic.php?t=$1&start=$2&postdays=$3&postorder=$4&highlight=$5 [L,NC]
RewriteRule ^mark-forum([0-9]*).html* viewforum.php?f=$1&mark=topics [L,NC]
RewriteRule ^updates-topic([0-9]*).html* viewtopic.php?t=$1&watch=topic [L,NC]
RewriteRule ^stop-updates-topic([0-9]*).html* viewtopic.php?t=$1&unwatch=topic [L,NC]
RewriteRule ^forum-([0-9]*).html viewforum.php?f=$1 [L,NC]
RewriteRule ^forum-([0-9]*).* viewforum.php?f=$1 [L,NC]
RewriteRule ^topic-([0-9]*)-([0-9]*)-([0-9]*).* viewforum.php?f=$1&topicdays=$2&start=$3 [L,NC]
RewriteRule ^ptopic([0-9]*).* viewtopic.php?t=$1&view=previous [L,NC]
RewriteRule ^ntopic([0-9]*).* viewtopic.php?t=$1&view=next [L,NC]
RewriteRule ^ara-([0-9]*)-([0-9]*).html search.php?search_id=$1&start=$2 [QSA,L]
RewriteRule ^arama-yazar-([a-zA-Z0-9_-]*).html search.php?&search_author=$1 [QSA,L]
RewriteRule ^cevapsiz.html search.php?search_id=$1 [QSA,L]
RewriteRule ^yeni-kayit.html profile.php?mode=register&agreed=true [QSA,L]
RewriteRule ^kayit-coppa.html profile.php?mode=register&agreed=true&coppa=true [QSA,L]
RewriteRule ^kayit.html profile.php?&mode=register [QSA,L]
RewriteRule ^bilgiduzenle.html profile.php?mode=editprofile [QSA,L]
RewriteRule ^kayipsifre.html profile.php?mode=sendpassword [QSA,L]
RewriteRule ^kategori-([0-9]*).html index.php\?c=$1 [QSA,L]
RewriteRule ^sss-([a-zA-Z0-9]*).html faq.php\?mode=$1 [QSA,L]
RewriteRule ^sss.html faq.php [QSA,L]
RewriteRule ^arama.htm search.php [QSA,L]

RewriteRule ^emaill-(.*).jpg email.php?adres=$1
RewriteRule ^emaill-(.*).gif email.php?adres=$1
MorYeL
PR0
PR0
 
Posts: 99
Joined: Fri Aug 11, 2006 12:13 pm

Postby dcz » Thu Feb 08, 2007 5:00 pm

All right .htaccess is ok.

For the approve mod we'll really deal with it in the zero dupe forum this time ;)

So, it then looks like the forum url is added twice for these links, I got wrong because you talked about abl2know redirections, and as a matter of fact they work perfecty : http://www.lavinya.net/phpBB2/about293.html

So it can be just that you hard coded the full phpBB url in the template or in the php code.

The problem occurs in the redirect() function, in includes/function.php.

If the full url was added in the php code, as it seems, you could do the following; open :


Code: Select all
includes/function.php


Find :

Code: Select all
function redirect($url)
{
   global $db, $board_config;

After add :

Code: Select all
   // www.phpBB-SEO.com SEO TOOLKIT BEGIN
   global $phpbb_seo;
   // www.phpBB-SEO.com SEO TOOLKIT END


Find :
Code: Select all
   if (strstr(urldecode($url), "\n") || strstr(urldecode($url), "\r") || strstr(urldecode($url), ';url'))
   {
      message_die(GENERAL_ERROR, 'Tried to redirect to potentially insecure url.');
   }


After add :

Code: Select all
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
if ( strpos($url, $phpbb_seo->seo_path['phpbb_url']) === FALSE ) {


Find :

Code: Select all
   $url = preg_replace('#^\/?(.*?)\/?$#', '/\1', trim($url));


After add :

Code: Select all
} else {
   $server_protocol = $server_name = $server_port = $script_name = '';
}
// www.phpBB-SEO.com SEO TOOLKIT END


This will allow the redirect function to only add the full url when it was not already added.
Note that this is inteded to wrok with the 0.2.2 and above mod rewrites.

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21411
Joined: Fri Apr 28, 2006 9:03 pm

Next

Return to phpBB2 Advanced mod Rewrite

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 3 guests