Mod_rewrite help !?

  • Daniel
  • Student
  • Student
  • Daniel
  • Posts: 91

Post 3+ Months Ago

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
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • djtheropy
  • Graduate
  • Graduate
  • djtheropy
  • Posts: 111

Post 3+ Months Ago

your url should have been rewritten to forum1.html not forum1.php
  • djtheropy
  • Graduate
  • Graduate
  • djtheropy
  • Posts: 111

Post 3+ Months Ago

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
  • Posts: 17
  • Loc: Ilkley, UK

Post 3+ Months Ago

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
  • madmonk
  • Posts: 2115
  • Loc: australia

Post 3+ Months Ago

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. :-)
  • Daniel
  • Student
  • Student
  • Daniel
  • Posts: 91

Post 3+ Months Ago

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
  • djtheropy
  • Posts: 111

Post 3+ Months Ago

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
  • Daniel
  • Posts: 91

Post 3+ Months Ago

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
  • djtheropy
  • Posts: 111

Post 3+ Months Ago

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
  • Brandon123
  • Posts: 10

Post 3+ Months Ago

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
  • madmonk
  • Posts: 2115
  • Loc: australia

Post 3+ Months Ago

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....
  • Daniel
  • Student
  • Student
  • Daniel
  • Posts: 91

Post 3+ Months Ago

well ill try again :(
  • Jess
  • Guru
  • Guru
  • User avatar
  • Posts: 1153
  • Loc: USA

Post 3+ Months Ago

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
  • Daniel
  • Posts: 91

Post 3+ Months Ago

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
  • Brandon123
  • Posts: 10

Post 3+ Months Ago

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.
  • Brandon123
  • Newbie
  • Newbie
  • Brandon123
  • Posts: 10

Post 3+ Months Ago

Daniel,

You and I still have the exact same problem.
  • Jess
  • Guru
  • Guru
  • User avatar
  • Posts: 1153
  • Loc: USA

Post 3+ Months Ago

Daniel wrote:
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 :(


Of course I read it all. But the 2nd pages not wotking isnt exactly getting it working in my books...........
  • Brandon123
  • Newbie
  • Newbie
  • Brandon123
  • Posts: 10

Post 3+ Months Ago

Jess wrote:
Daniel wrote:
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 :(


Of course I read it all. But the 2nd pages not wotking isnt exactly getting it working in my books...........


Jess, I believe you, but I'm wondering if your server told you anything specific about what was wrong with the mod rewrite rule or what they had to do to fix it?
  • Daniel
  • Student
  • Student
  • Daniel
  • Posts: 91

Post 3+ Months Ago

Well, everything works for mine except the 2nd pages of the topics, and yes my host does have mod_rewrite
  • Brandon123
  • Newbie
  • Newbie
  • Brandon123
  • Posts: 10

Post 3+ Months Ago

I submitted a ticket to my host. I'll let you guys know the answer. They are really good at technical support and will be able to tell me where the problem is located.
  • Jess
  • Guru
  • Guru
  • User avatar
  • Posts: 1153
  • Loc: USA

Post 3+ Months Ago

Brandon123 wrote:
Jess wrote:
Daniel wrote:
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 :(


Of course I read it all. But the 2nd pages not wotking isnt exactly getting it working in my books...........


Jess, I believe you, but I'm wondering if your server told you anything specific about what was wrong with the mod rewrite rule or what they had to do to fix it?


sorry - missed this post. No they didn't really tell me anything - just that they had resolved the issue. Was deffinately a mod rewrite problem their end.

Will be interesting to see if you have the same issue as I did.
  • djtheropy
  • Graduate
  • Graduate
  • djtheropy
  • Posts: 111

Post 3+ Months Ago

whats the url to the forums in question?

Ill have a look if ya like?
  • Daniel
  • Student
  • Student
  • Daniel
  • Posts: 91

Post 3+ Months Ago

http://www.webmaster-forums.co.uk (I took down the mod_rewrite as no1 could view/post on 2nd page of topics.)
  • Brandon123
  • Newbie
  • Newbie
  • Brandon123
  • Posts: 10

Post 3+ Months Ago

I checked with my server, and the problem is not on their end. It is within the rule itself. Oh well...
  • Jess
  • Guru
  • Guru
  • User avatar
  • Posts: 1153
  • Loc: USA

Post 3+ Months Ago

Brandon123 wrote:
I checked with my server, and the problem is not on their end. It is within the rule itself. Oh well...


It was worth a try :?
  • Brandon123
  • Newbie
  • Newbie
  • Brandon123
  • Posts: 10

Post 3+ Months Ago

Thanks Jess. It's the effor that counts sometimes. BTW, nice site. I tried to register on the forum (I always register on forums now to show my support), but I never recieved an activation key. Nice site anyway.
  • Jetlag
  • Newbie
  • Newbie
  • Jetlag
  • Posts: 12
  • Loc: Vancouver, Canada

Post 3+ Months Ago

Some Mods with Able2Know Mod will cause the 2nd pages from not working.

http://www.able2know.com/forums/about15132-0-asc-770.html
  • Daniel
  • Student
  • Student
  • Daniel
  • Posts: 91

Post 3+ Months Ago

yer but how do you fix it ?...
  • Jetlag
  • Newbie
  • Newbie
  • Jetlag
  • Posts: 12
  • Loc: Vancouver, Canada

Post 3+ Months Ago

Quote:
Are you using the Topic Display sort order MOD? If so, paddle back a few pages in this thread. No fix for it, I'm afraid

http://www.able2know.com/forums/about15132-0-asc-800.html
Post your problem in able2know forum and maybe they found a fix for it.
  • Brandon123
  • Newbie
  • Newbie
  • Brandon123
  • Posts: 10

Post 3+ Months Ago

It seems like the modrewrite rule either works or it doesn't. I've posted on several forums and have been unable to get an answer to the problem. I know that it is not a mod related problem because I tried to install it on a forum with no mod's.

However, I posted a question on Abletoknow today.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

Post Information

  • Total Posts in this topic: 40 posts
  • Users browsing this forum: No registered users and 5 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
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.