Mod_rewrite help !?
- Daniel
- Student


- Joined: Jun 18, 2004
- Posts: 91
- Status: Offline
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
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
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
- 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
- Anonymous
- Bot


- Joined: 25 Feb 2008
- Posts: ?
- Loc: Ozzuland
- Status: Online
October 28th, 2004, 2:01 pm
- djtheropy
- Graduate


- Joined: Nov 05, 2004
- Posts: 111
- Status: Offline
- djtheropy
- Graduate


- Joined: Nov 05, 2004
- Posts: 111
- Status: Offline
- woza
- Novice


- Joined: Nov 06, 2004
- Posts: 17
- Loc: Ilkley, UK
- Status: Offline
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]
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


- Joined: May 04, 2004
- Posts: 2115
- Loc: australia
- Status: Offline
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


- Joined: Jun 18, 2004
- Posts: 91
- Status: Offline
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
And this is what I put in the page_header.php after
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
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
- 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
And this is what I put in the page_header.php after
Code: [ Select ]
//
// Generate logged in/logged out status
//
// Generate logged in/logged out status
//
- //
- // Generate logged in/logged out status
- //
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;
}
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;
}
- 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;
- }
- djtheropy
- Graduate


- Joined: Nov 05, 2004
- Posts: 111
- Status: Offline
Here is the complete code and all the files that are needed to be edited for mod_rewrite for phpbb forums
© http://www.able2know.com
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]*)&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;
}
}
#
#-----[ 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;
}
}
- 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;
- }
- }
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;
}
#
#-----[ 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;
}
- 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;
- }
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]
#
#-----[ 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]
- .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]
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$
Disallow: forums/post-*.html$
Disallow: forums/updates-topic.html*$
Disallow: forums/stop-updates-topic.html*$
Disallow: forums/ptopic*.html$
Disallow: forums/ntopic*.html$
- 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$
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;
}
}
#
#-----[ FIND ]------------------------------------------
#
if (!empty($db))
{
$db->sql_close();
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
if ( !$userdata['session_logged_in'] )
{
if (stristr($url, 'http://')) {
header('Location: ' . $url);
exit;
}
}
- 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;
- }
- }
Code: [ Select ]
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
- #
- #-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
- #
- # EoM
© http://www.able2know.com
- Daniel
- Student


- Joined: Jun 18, 2004
- Posts: 91
- Status: Offline
- djtheropy
- Graduate


- Joined: Nov 05, 2004
- Posts: 111
- Status: Offline
- Brandon123
- Newbie


- Joined: Nov 09, 2004
- Posts: 10
- Status: Offline
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.
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


- Joined: May 04, 2004
- Posts: 2115
- Loc: australia
- Status: Offline
- Daniel
- Student


- Joined: Jun 18, 2004
- Posts: 91
- Status: Offline
- Jess
- Guru


- Joined: Sep 10, 2004
- Posts: 1153
- Loc: USA
- Status: Offline
- Daniel
- Student


- Joined: Jun 18, 2004
- Posts: 91
- Status: Offline
- Brandon123
- Newbie


- Joined: Nov 09, 2004
- Posts: 10
- Status: Offline
- Anonymous
- Bot


- Joined: 25 Feb 2008
- Posts: ?
- Loc: Ozzuland
- Status: Online
November 9th, 2004, 12:56 pm
To Reply to this topic you need to LOGIN or REGISTER. It is free.
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
