Mod_rewrite help !?

  • Daniel
  • Student
  • Student
  • No Avatar
  • Joined: Jun 18, 2004
  • Posts: 91
  • Status: Offline

Post October 28th, 2004, 2:01 pm

Hey, before every says to use serach I did :) I put this in this forum instead as it is to do with search eninges

Anyway I have a forum and my I managed to rewrite the urls so they are like /forum1.php anyway when I click the link it goes to a 404...Do I have to re-direct it somehow ? Or is the problem in the .htaccess ?

here is the code

Code: [ Select ]
RewriteEngine On
RewriteRule ^forums.* /index.php


RewriteRule ^viewforum([0-9]*)-([0-9]*)-([0-9]*).* /viewforum.php?f=$1&topicdays=$2&start=$3
RewriteRule ^mforum([0-9]*).* /viewforum.php?f=$1&mark=topic
RewriteRule ^forum([0-9]*).* /viewforum.php?f=$1

RewriteRule ^ptopic([0-9]*).* /viewtopic.php?t=$1&view=previous
RewriteRule ^ntopic([0-9]*).* /viewtopic.php?t=$1&view=next
RewriteRule ^newtopic([0-9]*).* /viewtopic.php?t=$1&view=newest
RewriteRule ^ftopic([0-9]*)-([0-9]*)-([a-zA-Z]*)-([0-9]*).* /viewtopic.php?t=$1&postdays=$2&postorder=$3&start=$4
RewriteRule ^ftopic([0-9]*)-([0-9]*)-([0-9]*)-([a-zA-Z]*)-([a-zA-Z]*).* /viewtopic.php?t=$1&start=$2&postdays=$3&postorder=$4&highlight=$5
RewriteRule ^ftopic([0-9]*)-([0-9]*).* /viewtopic.php?t=$1&start=$2
RewriteRule ^ftopic([0-9]*).* /viewtopic.php?t=$1
RewriteRule ^sutra([0-9]*).* /viewtopic.php?p=$1
  1. RewriteEngine On
  2. RewriteRule ^forums.* /index.php
  3. RewriteRule ^viewforum([0-9]*)-([0-9]*)-([0-9]*).* /viewforum.php?f=$1&topicdays=$2&start=$3
  4. RewriteRule ^mforum([0-9]*).* /viewforum.php?f=$1&mark=topic
  5. RewriteRule ^forum([0-9]*).* /viewforum.php?f=$1
  6. RewriteRule ^ptopic([0-9]*).* /viewtopic.php?t=$1&view=previous
  7. RewriteRule ^ntopic([0-9]*).* /viewtopic.php?t=$1&view=next
  8. RewriteRule ^newtopic([0-9]*).* /viewtopic.php?t=$1&view=newest
  9. RewriteRule ^ftopic([0-9]*)-([0-9]*)-([a-zA-Z]*)-([0-9]*).* /viewtopic.php?t=$1&postdays=$2&postorder=$3&start=$4
  10. RewriteRule ^ftopic([0-9]*)-([0-9]*)-([0-9]*)-([a-zA-Z]*)-([a-zA-Z]*).* /viewtopic.php?t=$1&start=$2&postdays=$3&postorder=$4&highlight=$5
  11. RewriteRule ^ftopic([0-9]*)-([0-9]*).* /viewtopic.php?t=$1&start=$2
  12. RewriteRule ^ftopic([0-9]*).* /viewtopic.php?t=$1
  13. RewriteRule ^sutra([0-9]*).* /viewtopic.php?p=$1
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post October 28th, 2004, 2:01 pm

  • djtheropy
  • Graduate
  • Graduate
  • No Avatar
  • Joined: Nov 05, 2004
  • Posts: 111
  • Status: Offline

Post November 5th, 2004, 4:04 pm

your url should have been rewritten to forum1.html not forum1.php
  • djtheropy
  • Graduate
  • Graduate
  • No Avatar
  • Joined: Nov 05, 2004
  • Posts: 111
  • Status: Offline

Post November 5th, 2004, 4:06 pm

also is your forum a phpbb forum (Like this forum) if so did you use the able to know SEOl mod first? I think that could be your problem !!
  • woza
  • Novice
  • Novice
  • User avatar
  • Joined: Nov 06, 2004
  • Posts: 17
  • Loc: Ilkley, UK
  • Status: Offline

Post November 6th, 2004, 4:55 pm

I have a phpbb plus forum and have this as my htaccess file. Works a treat! Hope it helps.
Quote:
RewriteEngine On
RewriteRule ^forums.* index.php [L,NC]
RewriteRule ^post-([0-9]*).html&highlight=([a-zA-Z0-9]*) sutra.html$1&highlight=$2 [L,NC]
RewriteRule ^post-([0-9]*).* sutra.html$1 [L,NC]
RewriteRule ^view-poll([0-9]*)-([0-9]*)-([a-zA-Z]*).* ftopic.html$1&postdays=$2&postorder=$3&vote=viewresult [L,NC]
RewriteRule ^about([0-9]*).html&highlight=([a-zA-Z0-9]*) ftopic.html$1&highlight=$2 [L,NC]
RewriteRule ^about([0-9]*).html&view=newest ftopic.html$1&view=newest [L,NC]
RewriteRule ^about([0-9]*)-([0-9]*)-([a-zA-Z]*)-([0-9]*).* ftopic.html$1&postdays=$2&postorder=$3&start=$4 [L,NC]
RewriteRule ^about([0-9]*)-([0-9]*).* ftopic.html$1&start=$2 [L,NC]
RewriteRule ^about([0-9]*).* ftopic.html$1 [L,NC]
RewriteRule ^about([0-9]*).html ftopic.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* ftopic.html$1&watch=topic [L,NC]
RewriteRule ^stop-updates-topic([0-9]*).html* ftopic.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]*).* ftopic.html$1&view=previous [L,NC]
RewriteRule ^ntopic([0-9]*).* ftopic.html$1&view=next [L,NC]
  • madmonk
  • Mastermind
  • Mastermind
  • No Avatar
  • Joined: May 04, 2004
  • Posts: 2115
  • Loc: australia
  • Status: Offline

Post November 7th, 2004, 2:11 am

Quote:
Anyway I have a forum and my I managed to rewrite the urls so they are like /forum1.php anyway when I click the link it goes to a 404...Do I have to re-direct it somehow ? Or is the problem in the .htaccess ?


yeah your rewrite mod is wrong. see example above. :-)
Tattoos Gallery
  • Daniel
  • Student
  • Student
  • No Avatar
  • Joined: Jun 18, 2004
  • Posts: 91
  • Status: Offline

Post November 7th, 2004, 4:51 am

Ok I have found a better one and everything works, except you can't view the 2nd pages of the topics. It just loads the first one again.

Here is my .htaccess

Code: [ Select ]
RewriteEngine On
RewriteRule ^forums.* index.php
RewriteRule ^forum([0-9]*).* viewforum.php?f=$1&mark=topic
RewriteRule ^viewforum([0-9]*)-([0-9]*)-([0-9]*).* viewforum.php?f=$1&topicdays=$2&start=$3
RewriteRule ^forum([0-9]*).* viewforum.php?f=$1
RewriteRule ^ptopic([0-9]*).* viewtopic.php?t=$1&view=previous
RewriteRule ^ntopic([0-9]*).* viewtopic.php?t=$1&view=next
RewriteRule ^ftopic([0-9]*)-([0-9]*)-([a-zA-Z]*)-([0-9]*).* viewtopic.php?t=$1&postdays=$2&postorder=$3&start=$4
RewriteRule ^ftopic([0-9]*)-([0-9]*).* viewtopic.php?t=$1&start=$2
RewriteRule ^ftopic([0-9]*).* viewtopic.php?t=$1
RewriteRule ^ftopic([0-9]*).html viewtopic.php?t=$1&start=$2&postdays=$3&postorder=$4&highlight=$5
RewriteRule ^sutra([0-9]*).* viewtopic.php?p=$1
  1. RewriteEngine On
  2. RewriteRule ^forums.* index.php
  3. RewriteRule ^forum([0-9]*).* viewforum.php?f=$1&mark=topic
  4. RewriteRule ^viewforum([0-9]*)-([0-9]*)-([0-9]*).* viewforum.php?f=$1&topicdays=$2&start=$3
  5. RewriteRule ^forum([0-9]*).* viewforum.php?f=$1
  6. RewriteRule ^ptopic([0-9]*).* viewtopic.php?t=$1&view=previous
  7. RewriteRule ^ntopic([0-9]*).* viewtopic.php?t=$1&view=next
  8. RewriteRule ^ftopic([0-9]*)-([0-9]*)-([a-zA-Z]*)-([0-9]*).* viewtopic.php?t=$1&postdays=$2&postorder=$3&start=$4
  9. RewriteRule ^ftopic([0-9]*)-([0-9]*).* viewtopic.php?t=$1&start=$2
  10. RewriteRule ^ftopic([0-9]*).* viewtopic.php?t=$1
  11. RewriteRule ^ftopic([0-9]*).html viewtopic.php?t=$1&start=$2&postdays=$3&postorder=$4&highlight=$5
  12. RewriteRule ^sutra([0-9]*).* viewtopic.php?p=$1


And this is what I put in the page_header.php after
Code: [ Select ]
//
// Generate logged in/logged out status
//
  1. //
  2. // Generate logged in/logged out status
  3. //
Code: [ Select ]
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'",
"'(?<!/)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]*)&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(
"viewforum\\1-\\2-\\3.html",
"forum\\1.html",
"forum\\1.html",
"ptopic\\1.html",
"ntopic\\1.html",
"ftopic\\1-\\2-\\3-\\4.html",
"ftopic\\1.html",
"ftopic\\1-\\2.html",
"ftopic\\1.html",
"sutra\\1.html",
"sutra\\1.html",
);
$s = preg_replace($urlin, $urlout, $s);
return $s;
}
  1. ob_start();
  2. function replace_for_mod_rewrite(&$s)
  3. {
  4. $urlin =
  5. array(
  6. "'(?<!/)viewforum.php\?f=([0-9]*)&topicdays=([0-9]*)&start=([0-9]*)'",
  7. "'(?<!/)viewforum.php\?f=([0-9]*)&mark=topics'",
  8. "'(?<!/)viewforum.php\?f=([0-9]*)'",
  9. "'(?<!/)viewtopic.php\?t=([0-9]*)&view=previous'",
  10. "'(?<!/)viewtopic.php\?t=([0-9]*)&view=next'",
  11. "'(?<!/)viewtopic.php\?t=([0-9]*)&postdays=([0-9]*)&postorder=([a-zA-Z]*)&start=([0-9]*)'",
  12. "'(?<!/)viewtopic.php\?t=([0-9]*)&start=([0-9]*)&postdays=([0-9]*)&postorder=([a-zA-Z]*)&highlight=([a-zA-Z0-9]*)'",
  13. "'(?<!/)viewtopic.php\?t=([0-9]*)&start=([0-9]*)'",
  14. "'(?<!/)viewtopic.php\?t=([0-9]*)'",
  15. "'(?<!/)viewtopic.php&p=([0-9]*)'",
  16. "'(?<!/)viewtopic.php\?p=([0-9]*)'",
  17. );
  18. $urlout = array(
  19. "viewforum\\1-\\2-\\3.html",
  20. "forum\\1.html",
  21. "forum\\1.html",
  22. "ptopic\\1.html",
  23. "ntopic\\1.html",
  24. "ftopic\\1-\\2-\\3-\\4.html",
  25. "ftopic\\1.html",
  26. "ftopic\\1-\\2.html",
  27. "ftopic\\1.html",
  28. "sutra\\1.html",
  29. "sutra\\1.html",
  30. );
  31. $s = preg_replace($urlin, $urlout, $s);
  32. return $s;
  33. }
  • djtheropy
  • Graduate
  • Graduate
  • No Avatar
  • Joined: Nov 05, 2004
  • Posts: 111
  • Status: Offline

Post November 7th, 2004, 4:37 pm

Here is the complete code and all the files that are needed to be edited for mod_rewrite for phpbb forums

Code: [ Select ]
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]*)&amp;topicdays=([0-9]*)&amp;start=([0-9]*)'",
"'(?<!/)viewforum.php\?f=([0-9]*)&amp;mark=topics'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&amp;watch=topic*'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&amp;unwatch=topic*'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&amp;highlight=*'",
"'(?<!/)viewforum.php\?f=([0-9]*)'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&amp;view=previous'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&amp;view=next'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&amp;postdays=([0-9]*)&amp;postorder=([a-zA-Z]*)&amp;vote=viewresult'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&amp;postdays=([0-9]*)&amp;postorder=([a-zA-Z]*)&amp;start=([0-9]*)'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&amp;start=([0-9]*)&amp;postdays=([0-9]*)&amp;postorder=([a-zA-Z]*)&amp;highlight=([a-zA-Z0-9]*)'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&amp;start=([0-9]*)'",
"'(?<!/)viewtopic.php\?t=([0-9]*)'",
"'(?<!/)viewtopic.php&amp;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&amp;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;
}
}
  1. includes/page_header.php
  2. #
  3. #-----[ FIND ]------------------------------------------
  4. #
  5. //
  6. // Generate logged in/logged out status
  7. //
  8. #
  9. #-----[ AFTER, ADD ]------------------------------------------
  10. #
  11. if ( !$userdata['session_logged_in'] )
  12. {
  13. ob_start();
  14. function replace_for_mod_rewrite(&$s)
  15. {
  16. $urlin =
  17. array(
  18. "'(?<!/)viewforum.php\?f=([0-9]*)&amp;topicdays=([0-9]*)&amp;start=([0-9]*)'",
  19. "'(?<!/)viewforum.php\?f=([0-9]*)&amp;mark=topics'",
  20. "'(?<!/)viewtopic.php\?t=([0-9]*)&amp;watch=topic*'",
  21. "'(?<!/)viewtopic.php\?t=([0-9]*)&amp;unwatch=topic*'",
  22. "'(?<!/)viewtopic.php\?t=([0-9]*)&amp;highlight=*'",
  23. "'(?<!/)viewforum.php\?f=([0-9]*)'",
  24. "'(?<!/)viewtopic.php\?t=([0-9]*)&amp;view=previous'",
  25. "'(?<!/)viewtopic.php\?t=([0-9]*)&amp;view=next'",
  26. "'(?<!/)viewtopic.php\?t=([0-9]*)&amp;postdays=([0-9]*)&amp;postorder=([a-zA-Z]*)&amp;vote=viewresult'",
  27. "'(?<!/)viewtopic.php\?t=([0-9]*)&amp;postdays=([0-9]*)&amp;postorder=([a-zA-Z]*)&amp;start=([0-9]*)'",
  28. "'(?<!/)viewtopic.php\?t=([0-9]*)&amp;start=([0-9]*)&amp;postdays=([0-9]*)&amp;postorder=([a-zA-Z]*)&amp;highlight=([a-zA-Z0-9]*)'",
  29. "'(?<!/)viewtopic.php\?t=([0-9]*)&amp;start=([0-9]*)'",
  30. "'(?<!/)viewtopic.php\?t=([0-9]*)'",
  31. "'(?<!/)viewtopic.php&amp;p=([0-9]*)'",
  32. "'(?<!/)viewtopic.php\?p=([0-9]*)'",
  33. );
  34. $urlout = array(
  35. "topic-\\1-\\2-\\3.html",
  36. "mark-forum\\1.html",
  37. "updates-topic\\1.html",
  38. "stop-updates-topic\\1.html",
  39. "about\\1.html&amp;highlight=\\2",
  40. "forum-\\1.html",
  41. "ptopic\\1.html",
  42. "ntopic\\1.html",
  43. "view-poll\\1-\\2-\\3.html",
  44. "about\\1-\\2-\\3-\\4.html",
  45. "about\\1.html",
  46. "about\\1-\\2.html",
  47. "about\\1.html",
  48. "post-\\1.html",
  49. "post-\\1.html",
  50. );
  51. $s = preg_replace($urlin, $urlout, $s);
  52. return $s;
  53. }
  54. }


Code: [ Select ]
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;
}
  1. includes/page_tail.php
  2. #
  3. #-----[ FIND ]------------------------------------------
  4. #
  5. $db->sql_close();
  6. #
  7. #-----[ AFTER, ADD ]------------------------------------------
  8. #
  9. if ( !$userdata['session_logged_in'] )
  10. {
  11. $contents = ob_get_contents();
  12. ob_end_clean();
  13. echo replace_for_mod_rewrite($contents);
  14. global $dbg_starttime;
  15. }


Code: [ Select ]
.htaccess (Should be in forum root)

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


RewriteEngine On
RewriteRule ^forums.* index.php [L,NC]
RewriteRule ^post-([0-9]*).html&highlight=([a-zA-Z0-9]*) sutra.html$1&highlight=$2 [L,NC]
RewriteRule ^post-([0-9]*).* sutra.html$1 [L,NC]
RewriteRule ^view-poll([0-9]*)-([0-9]*)-([a-zA-Z]*).* ftopic.html$1&postdays=$2&postorder=$3&vote=viewresult [L,NC]
RewriteRule ^about([0-9]*).html&highlight=([a-zA-Z0-9]*) ftopic.html$1&highlight=$2 [L,NC]
RewriteRule ^about([0-9]*).html&view=newest ftopic.html$1&view=newest [L,NC]
RewriteRule ^about([0-9]*)-([0-9]*)-([a-zA-Z]*)-([0-9]*).* ftopic.html$1&postdays=$2&postorder=$3&start=$4 [L,NC]
RewriteRule ^about([0-9]*)-([0-9]*).* ftopic.html$1&start=$2 [L,NC]
RewriteRule ^about([0-9]*).* ftopic.html$1 [L,NC]
RewriteRule ^about([0-9]*).html ftopic.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* ftopic.html$1&watch=topic [L,NC]
RewriteRule ^stop-updates-topic([0-9]*).html* ftopic.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]*).* ftopic.html$1&view=previous [L,NC]
RewriteRule ^ntopic([0-9]*).* ftopic.html$1&view=next [L,NC]
  1. .htaccess (Should be in forum root)
  2. #
  3. #-----[ ADD ]------------------------------------------
  4. RewriteEngine On
  5. RewriteRule ^forums.* index.php [L,NC]
  6. RewriteRule ^post-([0-9]*).html&highlight=([a-zA-Z0-9]*) sutra.html$1&highlight=$2 [L,NC]
  7. RewriteRule ^post-([0-9]*).* sutra.html$1 [L,NC]
  8. RewriteRule ^view-poll([0-9]*)-([0-9]*)-([a-zA-Z]*).* ftopic.html$1&postdays=$2&postorder=$3&vote=viewresult [L,NC]
  9. RewriteRule ^about([0-9]*).html&highlight=([a-zA-Z0-9]*) ftopic.html$1&highlight=$2 [L,NC]
  10. RewriteRule ^about([0-9]*).html&view=newest ftopic.html$1&view=newest [L,NC]
  11. RewriteRule ^about([0-9]*)-([0-9]*)-([a-zA-Z]*)-([0-9]*).* ftopic.html$1&postdays=$2&postorder=$3&start=$4 [L,NC]
  12. RewriteRule ^about([0-9]*)-([0-9]*).* ftopic.html$1&start=$2 [L,NC]
  13. RewriteRule ^about([0-9]*).* ftopic.html$1 [L,NC]
  14. RewriteRule ^about([0-9]*).html ftopic.html$1&start=$2&postdays=$3&postorder=$4&highlight=$5 [L,NC]
  15. RewriteRule ^mark-forum([0-9]*).html* forum.html$1&mark=topics [L,NC]
  16. RewriteRule ^updates-topic([0-9]*).html* ftopic.html$1&watch=topic [L,NC]
  17. RewriteRule ^stop-updates-topic([0-9]*).html* ftopic.html$1&unwatch=topic [L,NC]
  18. RewriteRule ^forum-([0-9]*).html forum.html$1 [L,NC]
  19. RewriteRule ^forum-([0-9]*).* forum.html$1 [L,NC]
  20. RewriteRule ^topic-([0-9]*)-([0-9]*)-([0-9]*).* forum.html$1&topicdays=$2&start=$3 [L,NC]
  21. RewriteRule ^ptopic([0-9]*).* ftopic.html$1&view=previous [L,NC]
  22. RewriteRule ^ntopic([0-9]*).* ftopic.html$1&view=next [L,NC]


Code: [ Select ]
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$
  1. robots.txt
  2. Disallow: forums/post-*.html$
  3. Disallow: forums/updates-topic.html*$
  4. Disallow: forums/stop-updates-topic.html*$
  5. Disallow: forums/ptopic*.html$
  6. Disallow: forums/ntopic*.html$


Code: [ Select ]
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;
}
}
  1. includes/functions.php
  2. #
  3. #-----[ FIND ]------------------------------------------
  4. if (!empty($db))
  5. {
  6.    $db->sql_close();
  7. }
  8. #
  9. #-----[ AFTER, ADD ]------------------------------------------
  10. #
  11. if ( !$userdata['session_logged_in'] )
  12. {
  13. if (stristr($url, 'http://')) {
  14.  header('Location: ' . $url);
  15.  exit;
  16. }
  17. }


Code: [ Select ]
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM 
  1. #
  2. #-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
  3. #
  4. # EoM 

© http://www.able2know.com
  • Daniel
  • Student
  • Student
  • No Avatar
  • Joined: Jun 18, 2004
  • Posts: 91
  • Status: Offline

Post November 8th, 2004, 9:12 am

yer I used able to know in the first place but it didn't allow anyone to view the 2nd pages of the topics.....
  • djtheropy
  • Graduate
  • Graduate
  • No Avatar
  • Joined: Nov 05, 2004
  • Posts: 111
  • Status: Offline

Post November 8th, 2004, 7:58 pm

well thats the full code in its unchanged form it worked for me so it should work for you.

have you installed the mod that gets rid of session ids?
  • Brandon123
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Nov 09, 2004
  • Posts: 10
  • Status: Offline

Post November 9th, 2004, 1:02 am

I have the same problem as Daniel. I think that I have found the problem. The rule was written as if the forums reside in the root directories. My forum resides in the "forums" directories -- e.g. http://www.mydomain.com/forums.

Can anyone tell me where I need to alter the mod to adjust it for my forums directory?

I think that will fix it. But there are a lot of places to alter the mod and I know need to know what I need to change specifically.
  • madmonk
  • Mastermind
  • Mastermind
  • No Avatar
  • Joined: May 04, 2004
  • Posts: 2115
  • Loc: australia
  • Status: Offline

Post November 9th, 2004, 5:03 am

yeah. put the htaccess in the folder of your forum
I think thats what i did the last time....
it was months ago :-(
but it should work....
Tattoos Gallery
  • Daniel
  • Student
  • Student
  • No Avatar
  • Joined: Jun 18, 2004
  • Posts: 91
  • Status: Offline

Post November 9th, 2004, 9:15 am

well ill try again :(
  • Jess
  • Guru
  • Guru
  • User avatar
  • Joined: Sep 10, 2004
  • Posts: 1153
  • Loc: USA
  • Status: Offline

Post November 9th, 2004, 9:22 am

Are you sure your host has their rewrite engine working right on the server?

I ad thid problem once - tried everything. The in the end I contacted my host and they found the fault was their end. Maybe worth checking?
  • Daniel
  • Student
  • Student
  • No Avatar
  • Joined: Jun 18, 2004
  • Posts: 91
  • Status: Offline

Post November 9th, 2004, 12:33 pm

Did you read the whole thing jess? If so you would of seen the bit were I said I got it working yet I couldn't view the 2nd pages of the topics :(
  • Brandon123
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Nov 09, 2004
  • Posts: 10
  • Status: Offline

Post November 9th, 2004, 12:56 pm

Jess,

What you say definitely makes sense. By any chance, did your server tell you what was wrong? I'm going to write a trouble ticket with my server, but I want to try to be as specific as possible.
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post November 9th, 2004, 12:56 pm

Post Information

  • Total Posts in this topic: 40 posts
  • Users browsing this forum: No registered users and 21 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.