1
   

pbpBB SEO static url modify not working

 
 
Reply Sat 22 May, 2004 10:08 am
Please review this and see if there are any errors, this is from computerbb org and I can not get this to work on my phpBB 2.0.8 with the phpbb(search engine optimization) modify you wrote. I appreciate all your assistance, as I am feeling frustrated by not accomplishing this task. My forum is located in mywebsite/forum/ . After this modify, I can not open topics or forums without logging on first. I have not done any other modifies but the phpBBhacks SEO you wrote, which worked perfectly. In addition, in your download 2.0.0 the text file explaining this modification is hard to read cause of coding blocks, If you could replace it with a clean text document, that would be great.

Code:#
#-----[ OPEN ]------------------------------------------
#

includes/page_header.php

#
#-----[ FIND ]------------------------------------------
#

//
// Generate logged in/logged out status
//

#
#-----[ AFTER, ADD ]------------------------------------------
#

if ( !$userdata['session_logged_in'] )
{
ob_start();
function replace_for_mod_rewrite(&$s)
{
$urlin =
array(
"'(?<!/)viewforum.php\?f=([0-9]*)&topicdays=([0-9]*)&start=([0-9]*)'",
"'(?<!/)viewforum.php\?f=([0-9]*)&mark=topics'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&watch=topic*'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&unwatch=topic*'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&highlight=*'",
"'(?<!/)viewforum.php\?f=([0-9]*)'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&view=previous'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&view=next'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&postdays=([0-9]*)&postorder=([a-zA-Z]*)&vote=viewresult'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&postdays=([0-9]*)&postorder=([a-zA-Z]*)&start=([0-9]*)'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&start=([0-9]*)&postdays=([0-9]*)&postorder=([a-zA-Z]*)&highlight=([a-zA-Z0-9]*)'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&start=([0-9]*)'",
"'(?<!/)viewtopic.php\?t=([0-9]*)'",
"'(?<!/)viewtopic.php&p=([0-9]*)'",
"'(?<!/)viewtopic.php\?p=([0-9]*)'",
);
$urlout = array(
"topic-\\1-\\2-\\3.html",
"mark-forum\\1.html",
"updates-topic\\1.html",
"stop-updates-topic\\1.html",
"about\\1.html&highlight=\\2",
"forum-\\1.html",
"ptopic\\1.html",
"ntopic\\1.html",
"view-poll\\1-\\2-\\3.html",
"about\\1-\\2-\\3-\\4.html",
"about\\1.html",
"about\\1-\\2.html",
"about\\1.html",
"post-\\1.html",
"post-\\1.html",
);
$s = preg_replace($urlin, $urlout, $s);
return $s;
}
}

#
#-----[ OPEN ]------------------------------------------
#

includes/page_tail.php

#
#-----[ FIND ]------------------------------------------
#

$db->sql_close();

#
#-----[ AFTER, ADD ]------------------------------------------
#

if ( !$userdata['session_logged_in'] )
{
$contents = ob_get_contents();
ob_end_clean();
echo replace_for_mod_rewrite($contents);
global $dbg_starttime;
}

#
#-----[ OPEN ]------------------------------------------
#

.htaccess

#
#-----[ ADD ]------------------------------------------
#

RewriteEngine On
RewriteRule ^forum.* index.php [L,NC]
RewriteRule ^post-([0-9]*).html&highlight=([a-zA-Z0-9]*) post-.html$1&highlight=$2 [L,NC]
RewriteRule ^post-([0-9]*).* post-.html$1 [L,NC]
RewriteRule ^view-poll([0-9]*)-([0-9]*)-([a-zA-Z]*).* about.html$1&postdays=$2&postorder=$3&vote=viewresult [L,NC]
RewriteRule ^about([0-9]*).html&highlight=([a-zA-Z0-9]*) about.html$1&highlight=$2 [L,NC]
RewriteRule ^about([0-9]*).html&view=newest about.html$1&view=newest [L,NC]
RewriteRule ^about([0-9]*)-([0-9]*)-([a-zA-Z]*)-([0-9]*).* about.html$1&postdays=$2&postorder=$3&start=$4 [L,NC]
RewriteRule ^about([0-9]*)-([0-9]*).* about.html$1&start=$2 [L,NC]
RewriteRule ^about([0-9]*).* about.html$1 [L,NC]
RewriteRule ^about([0-9]*).html about.html$1&start=$2&postdays=$3&postorder=$4&highlight=$5 [L,NC]
RewriteRule ^mark-forum([0-9]*).html* forum-.html$1&mark=topics [L,NC]
RewriteRule ^updates-topic([0-9]*).html* about.html$1&watch=topic [L,NC]
RewriteRule ^stop-updates-topic([0-9]*).html* about.html$1&unwatch=topic [L,NC]
RewriteRule ^forum-([0-9]*).html forum-.html$1 [L,NC]
RewriteRule ^forum-([0-9]*).* forum-.html$1 [L,NC]
RewriteRule ^topic-([0-9]*)-([0-9]*)-([0-9]*).* forum-.html$1&topicdays=$2&start=$3 [L,NC]
RewriteRule ^ptopic([0-9]*).* about.html$1&view=previous [L,NC]
RewriteRule ^ntopic([0-9]*).* about.html$1&view=next [L,NC]


#
#-----[ OPEN ]------------------------------------------
#

robots.txt

Disallow: forums/post-*.html$
Disallow: forums/updates-topic.html*$
Disallow: forums/stop-updates-topic.html*$
Disallow: forums/ptopic*.html$
Disallow: forums/ntopic*.html$

#
#-----[ OPEN ]------------------------------------------
#

includes/functions.php

#
#-----[ FIND ]------------------------------------------
#

if (!empty($db))
{
$db->sql_close();
}

#
#-----[ AFTER, ADD ]------------------------------------------
#

if ( !$userdata['session_logged_in'] )
{
if (stristr($url, 'http://')) {
header('Location: ' . $url);
exit;
}
}

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM


I followed these instructions, and did this twice to re-check. The problem seems to be that the url's become static, but topics and forums do not open without logging on. With all sincerety, please help clear up this confusion. I do not share your expertise in the area. Thanks, Eric
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Discussion • Score: 1 • Views: 1,162 • Replies: 8
No top replies

 
Chosos
 
  1  
Reply Sat 22 May, 2004 11:27 pm
i have the exact same problem.
0 Replies
 
Chosos
 
  1  
Reply Sat 22 May, 2004 11:59 pm
Code:RewriteEngine On
RewriteRule ^forums.* index.php [L,NC]
RewriteRule ^post-([0-9]*).html&highlight=([a-zA-Z0-9]*) http://forums.fix-it.org/viewtopic.php?p=$1&highlight=$2 [L,NC]
RewriteRule ^post-([0-9]*).* http://forums.fix-it.org/viewtopic.php?p=$1 [L,NC]
RewriteRule ^view-poll([0-9]*)-([0-9]*)-([a-zA-Z]*).* http://forums.fix-it.org/viewtopic.php?t=$1&postdays=$2&postorder=$3&vote=viewresult [L,NC]
RewriteRule ^about([0-9]*).html&highlight=([a-zA-Z0-9]*) http://forums.fix-it.org/viewtopic.php?t=$1&highlight=$2 [L,NC]
RewriteRule ^about([0-9]*).html&view=newest http://forums.fix-it.org/viewtopic.php?t=$1&view=newest [L,NC]
RewriteRule ^about([0-9]*)-([0-9]*)-([a-zA-Z]*)-([0-9]*).* http://forums.fix-it.org/viewtopic.php?t=$1&postdays=$2&postorder=$3&start=$4 [L,NC]
RewriteRule ^about([0-9]*)-([0-9]*).* http://forums.fix-it.org/viewtopic.php?t=$1&start=$2 [L,NC]
RewriteRule ^about([0-9]*).* http://forums.fix-it.org/viewtopic.php?t=$1 [L,NC]
RewriteRule ^about([0-9]*).html http://forums.fix-it.org/viewtopic.php?t=$1&start=$2&postdays=$3&postorder=$4&highlight=$5 [L,NC]
RewriteRule ^mark-forum([0-9]*).html* http://forums.fix-it.org/viewforum.php?f=$1&mark=topics [L,NC]
RewriteRule ^updates-topic([0-9]*).html* http://forums.fix-it.org/viewtopic.php?t=$1&watch=topic [L,NC]
RewriteRule ^stop-updates-topic([0-9]*).html* http://forums.fix-it.org/viewtopic.php?t=$1&unwatch=topic [L,NC]
RewriteRule ^forum-([0-9]*).html http://forums.fix-it.org/viewforum.php?f=$1 [L,NC]
RewriteRule ^forum-([0-9]*).* http://forums.fix-it.org/viewforum.php?f=$1 [L,NC]
RewriteRule ^topic-([0-9]*)-([0-9]*)-([0-9]*).* http://forums.fix-it.org/viewforum.php?f=$1&topicdays=$2&start=$3 [L,NC]
RewriteRule ^ptopic([0-9]*).* http://forums.fix-it.org/viewtopic.php?t=$1&view=previous [L,NC]
RewriteRule ^ntopic([0-9]*).* http://forums.fix-it.org/viewtopic.php?t=$1&view=next [L,NC]


Eric, this fixed it for me.. add your URL like i did..
0 Replies
 
Eric Bland
 
  1  
Reply Mon 24 May, 2004 01:56 pm
Still same problem, this is becoming a pesky glich. Anyone have the answer? I tried this code in the mod_rewrite. maybe I need to adjust the includes/head? I have been using trial and error for awile. Need a whiz to shed some light my way on this one. Craven can you assist me on this?

Code:RewriteEngine On
RewriteRule ^forum.* index.php [L,NC]
RewriteRule ^post-([0-9]*).html&highlight=([a-zA-Z0-9]*) http://www.mywebsite.com/forum/viewtopic.php?p=$1&highlight=$2 [L,NC]
RewriteRule ^post-([0-9]*).* http://www.mywebsite.com/forum//viewtopic.php?p=$1 [L,NC]
RewriteRule ^view-poll([0-9]*)-([0-9]*)-([a-zA-Z]*).* http://www.mywebsite.com/forum/viewtopic.php?t=$1&postdays=$2&postorder=$3&vote=viewresult [L,NC]
RewriteRule ^about([0-9]*).html&highlight=([a-zA-Z0-9]*) http://www.mywebsite.com/forum/viewtopic.php?t=$1&highlight=$2 [L,NC]
RewriteRule ^about([0-9]*).html&view=newest http://www.mywebsite.com/forum/viewtopic.php?t=$1&view=newest [L,NC]
RewriteRule ^about([0-9]*)-([0-9]*)-([a-zA-Z]*)-([0-9]*).* http://www.mywebsite.com/forum/viewtopic.php?t=$1&postdays=$2&postorder=$3&start=$4 [L,NC]
RewriteRule ^about([0-9]*)-([0-9]*).* http://www.mywebsite.com/forum/viewtopic.php?t=$1&start=$2 [L,NC]
RewriteRule ^about([0-9]*).* http://www.mywebsite.com/forum/viewtopic.php?t=$1 [L,NC]
RewriteRule ^about([0-9]*).html http://www.mywebsite.com/forum/viewtopic.php?t=$1&start=$2&postdays=$3&postorder=$4&highlight=$5 [L,NC]
RewriteRule ^mark-forum([0-9]*).html* http://www.mywebsite.com/forum/viewforum.php?f=$1&mark=topics [L,NC]
RewriteRule ^updates-topic([0-9]*).html* http://www.mywebsite.com/forum/viewtopic.php?t=$1&watch=topic [L,NC]
RewriteRule ^stop-updates-topic([0-9]*).html* http://www.mywebsite.com/forum/viewtopic.php?t=$1&unwatch=topic [L,NC]
RewriteRule ^forum-([0-9]*).html http://www.mywebsite.com/forum/viewforum.php?f=$1 [L,NC]
RewriteRule ^forum-([0-9]*).* http://www.mywebsite.com/forum/viewforum.php?f=$1 [L,NC]
RewriteRule ^topic-([0-9]*)-([0-9]*)-([0-9]*).* http://www.mywebsite.com/forum/viewforum.php?f=$1&topicdays=$2&start=$3 [L,NC]
RewriteRule ^ptopic([0-9]*).* http://www.mywebsite.com/forum/viewtopic.php?t=$1&view=previous [L,NC]
RewriteRule ^ntopic([0-9]*).* http://www.mywebsite.com/forum/viewtopic.php?t=$1&view=next [L,NC]
0 Replies
 
Craven de Kere
 
  1  
Reply Mon 24 May, 2004 02:08 pm
I don't know why, but the code you have posted looks mangled.

Here is the original .htaccess code:

Code:RewriteEngine On
RewriteRule ^forums.* index.php [L,NC]
RewriteRule ^post-([0-9]*).html&highlight=([a-zA-Z0-9]*) viewtopic.php?p=$1&highlight=$2 [L,NC]
RewriteRule ^post-([0-9]*).* 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]


Drop that into your htaccess file IN YOUR FORUM DIRECTORY and see what happens. Replace any other attempts with thaat code, of course, and make sure there's only one call to the rewrite engine ( RewriteEngine On ).
0 Replies
 
Craven de Kere
 
  1  
Reply Mon 24 May, 2004 02:10 pm
BTW, if you get my code from any site other than this then you should make sure they didn't mess it up. Many people have been posting my tutorials and mods on other sites and getting it wrong.
0 Replies
 
Eric Bland
 
  1  
Reply Mon 24 May, 2004 04:17 pm
Nice!
Thanks Craven. That worked perfectly!
0 Replies
 
Craven de Kere
 
  1  
Reply Mon 24 May, 2004 04:24 pm
Seems like all ya had to do was follow the default mod directions. When you get my code from others they might break it.
0 Replies
 
Eric Bland
 
  1  
Reply Tue 25 May, 2004 08:48 am
I'll come directly to the source from now on. Craven, if you register at my forum: ceowebsites com, I will title you as a visiting Admin from time to time.
0 Replies
 
 

Related Topics

In How much time a website can be developed? - Question by aussiejumpingcastle
Webdevelopment and hosting - Question by harisit2005
Showing an Ico File - Discussion by Brandon9000
how to earn money in internet - Discussion by rizwanaraj
The version 10 bug. Worse then Y2K! - Discussion by Nick Ashley
CSS Border style colors - Question by meesa
There is no Wisdom in Crowds - Discussion by ebrown p
THANK YOU CRAVEN AND NICK!!! - Discussion by dagmaraka
I'm the developer - Discussion by Nick Ashley
 
  1. Forums
  2. » pbpBB SEO static url modify not working
Copyright © 2021 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.03 seconds on 10/20/2021 at 09:20:09