SEO Coding

Tips and help with HTML, CSS, JavaScript, and site development.
Post Reply
Eric Bland
Registered User
Posts: 10
Joined: May 21st, 2004, 7:22 am

SEO Coding

Post by Eric Bland »

After this modify, I can not open topics or forums without logging on first.

Code: Select all

Code or Script:
includes/page_header.php 
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; 
} 
} 


includes/page_tail.php 

$db->sql_close(); 

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

.htaccess 

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] 


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$ 

includes/functions.php 

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


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

 
Last edited by Eric Bland on June 28th, 2004, 8:05 pm, edited 4 times in total.
User avatar
ccb056
Site Administrator
Posts: 981
Joined: January 14th, 2004, 11:36 pm
Location: Texas
Contact:

Post by ccb056 »

You cannot view topics when not logged in? Does it give you a 404 error message or a login screen?
Eric Bland
Registered User
Posts: 10
Joined: May 21st, 2004, 7:22 am

Forum Networking Eric Bland

Post by Eric Bland »

No, I am trying some other things though.
Also, I'm looking for header or footer links to buy and trade links:Buy Footer Links or Trade links
Last edited by Eric Bland on July 1st, 2004, 5:11 pm, edited 7 times in total.
User avatar
ccb056
Site Administrator
Posts: 981
Joined: January 14th, 2004, 11:36 pm
Location: Texas
Contact:

Post by ccb056 »

I just went there now, it works for me as guest and logged-in.
Eric Bland
Registered User
Posts: 10
Joined: May 21st, 2004, 7:22 am

Post by Eric Bland »

Craven helped me find the error. The mod_rewrite was causing it. How do you add the forum topics in your header, I want to add that in mine. Do you have a site map also? I gave you a forum site admin rank at my forum. Website Designs
Last edited by Eric Bland on July 16th, 2004, 5:57 pm, edited 1 time in total.
User avatar
ccb056
Site Administrator
Posts: 981
Joined: January 14th, 2004, 11:36 pm
Location: Texas
Contact:

Post by ccb056 »

I had to manually add all those in the overall_header.tpl file.
Post Reply