2
   

translate to mod rewrite?

 
 
Reply Thu 12 Aug, 2004 07:31 pm
I installed a premodded forum and for the page numbers I get this:

ftopic3317.html&postdays=0&postorder=asc&&start=15

it originally looks like this on another forum that doesn't have rewrite on:

/viewtopic.php?t=1631&postdays=0&postorder=asc&&start=10

Can anyone give me suggestions as to how I should modify my rewrite?

It looks like this currently:

Code: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 ftopic(.*)-(.*)-(.*)-(.*)-(.*)\.htm$ /viewtopic.php?t=$1&postdays=$2&postorder=$3&=$4&start=$5
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Discussion • Score: 2 • Views: 2,490 • Replies: 7
No top replies

 
Craven de Kere
 
  1  
Reply Thu 12 Aug, 2004 10:55 pm
Re: translate to mod rewrite?
khisanthax wrote:
Can anyone give me suggestions as to how I should modify my rewrite?


Well... you can use the mod_rewrite code in my mod...

Quote:
It looks like this currently:


That's only half of it, the other half is in the phpbb code, see my mod, and replace their code with mine all around and you should be fine.
0 Replies
 
khisanthax
 
  1  
Reply Fri 13 Aug, 2004 07:03 am
I wanted to switch to your code by my concern is that if I do it now the pages that google has indexed will return error pages instead. Is there a workaround for that?
0 Replies
 
Craven de Kere
 
  1  
Reply Sat 14 Aug, 2004 01:51 am
Yes, just leave the previous rewrite rules (the .htaccess code only) below the new ones.
0 Replies
 
khisanthax
 
  1  
Reply Mon 16 Aug, 2004 07:16 pm
I tried and got "the forum you selected does not exist"

this is my htaccess:

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]*)-([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

#able2know rules
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]

I did everything just as you said except I didn't include the if user logged in because I wanted it for members as well. Would that be the problem?
0 Replies
 
zrock
 
  1  
Reply Tue 17 Aug, 2004 07:47 am
khisanthax wrote:
I tried and got "the forum you selected does not exist"
I did everything just as you said except I didn't include the if user logged in because I wanted it for members as well. Would that be the problem?


I believe the user loggedin part is to ensure that registered users don't lose their session

based on your example, previous rewrite rules are above the new ones instead of below them as suggested by Craven. Have you tried re-arranging the rules as indicated below?

Craven de Kere wrote:

Yes, just leave the previous rewrite rules (the .htaccess code only) below the new ones
0 Replies
 
khisanthax
 
  1  
Reply Sat 21 Aug, 2004 04:25 pm
you're absolutely right, it was very silly of me to miss that.
0 Replies
 
khisanthax
 
  1  
Reply Thu 26 Aug, 2004 05:31 pm
will doing this, which seemingly changes the pages, affect page ranks and how google ranks your various topics for search results?
0 Replies
 
 

Related Topics

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. » translate to mod rewrite?
Copyright © 2025 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.03 seconds on 01/17/2025 at 05:32:07