Forum Moderators: phranque
like domain/forum can you make up something from this....
php_flag register_globals off
php_flag display_errors off
RewriteEngine on
Options All -Indexes
# deny most common except .php
<FilesMatch "\.(inc¦tpl¦h¦ihtml¦sql¦ini¦conf¦class¦bin¦spd¦theme¦module)$">
deny from all
</FilesMatch>
<Limit GET PUT POST>
Order Allow,Deny
Allow from all
</Limit>
#Forums
RewriteRule ^ftopic-([0-9]*)-([0-9]*)-days([0-9]*)-order(desc¦asc)-([A-Za-z0-9_-]*).html viewtopic.php?t=$1&start=$2&postdays=$3&postorder=$4&highlight=$5 [L]
RewriteRule ^ftopic-([0-9]*)-days([0-9]*)-order(desc¦asc)-([0-9]*).html viewtopic.php?t=$1&postdays=$2&postorder=$3&start=$4 [L]
RewriteRule ^ftopic-([0-9]*)-([0-9]*).html viewtopic.php?t=$1&start=$2 [L]
RewriteRule ^ftopic-([0-9]*)-(previous¦next).html viewtopic.php?t=$1&view=$2 [L]
RewriteRule ^ftopic(t¦p)-([0-9]*)-([A-Za-z0-9_-]*).html viewtopic.php?$1=$2&highlight=$3 [L]
RewriteRule ^ftopic-([0-9]*)-(watch¦unwatch)-([0-9]*).html viewtopic.php?t=$1&$2=topic&start=$3 [L]
RewriteRule ^ftopic(t¦p)-([0-9]*).html viewtopic.php?$1=$2 [L]
RewriteRule ^ftopic(t¦p)-([0-9]*).html#([0-9]*) viewtopic.php?$1=$2#$3 [L]
RewriteRule ^forum-editprofile.html profile.php?mode=editprofile [L]
RewriteRule ^forum-userprofile-([0-9]*).html profile.php?mode=viewprofile&u=$1 [L]
RewriteRule ^forum-register-new.html profile&mode=register.php?agreed=true [L]
RewriteRule ^forum-register-coppa.html profile&mode=register.php?agreed=true&coppa=true [L]
RewriteRule ^forum-register.html profile&mode=register.php [L]
RewriteRule ^forums-posting.html posting.php [L]
RewriteRule ^forum-faq-bbcode.html faq.php?mode=bbcode [L]
RewriteRule ^topic-post-([0-9]*).html posting.php?t=$1 [L]
RewriteRule ^topic-vote-([0-9]*).html posting.php?mode=vote&t=$1 [L]
RewriteRule ^topic-new-([0-9]*).html posting.php?mode=newtopic&f=$1 [L]
RewriteRule ^topic-reply-([0-9]*).html posting.php?mode=reply&t=$1 [L]
RewriteRule ^topic-view-([0-9]*).html viewtopic.php?t=$1 [L]
RewriteRule ^topic-edit-([0-9]*).html posting.php?mode=editpost&p=$1 [L]
RewriteRule ^topic-smilies.html posting.php?mode=smilies&popup=1 [L]
RewriteRule ^topic-quote-([0-9]*).html posting.php?mode=quote&p=$1 [L]
RewriteRule ^forum-posting.html posting.php [L]
RewriteRule ^forums-group([0-9]*).html groupcp.php?g=$1 [L]
RewriteRule ^search-author-([a-zA-Z0-9_-]*).html search.php?&search_author=$1 [L]
RewriteRule ^search-([0-9]*)-([0-9]*).html search.php?search_id=$1&start=$2 [L]
RewriteRule ^search-(unanswered¦egosearch¦newposts).html search.php?search_id=$1 [L]
RewriteRule ^search-results.html search.php?mode=results [L]
RewriteRule ^forums-([^index][a-zA-Z0-9_-]*).html $1 [L]
RewriteRule ^forum-c([0-9]*).html index.php?c=$1 [L]
RewriteRule ^forum-mark.html index.php?&mark=forums [L]
RewriteRule ^forums.html index.php [L]
RewriteRule ^forum-viewonline.html viewonline.php [L]
RewriteRule ^forum-([0-9]*)-days([0-9]*)-([0-9]*).html viewforum.php?f=$1&topicdays=$2&start=$3 [L]
RewriteRule ^forum-([0-9]*)-([0-9]*).html viewforum.php?f=$1&start=$2 [L]
RewriteRule ^forum-([0-9]*)-mark.html viewforum.php?f=$1&mark=topics [L]
RewriteRule ^forum-([0-9]*).html viewforum.php?f=$1 [L]
RewriteRule ^forums.html index.php [L]
Move that code into an .htaccess file in the subfolder.
-or-
Add the name of your subfolder to the rewriterule patterns.
Example from your first rule:
RewriteRule ^[b]forum/[/b]ftopic-([0-9]*)-([0-9]*)-days([0-9]*)-order(desc¦asc)-([A-Za-z0-9_-]*)\.html
Jim
Here is the recap...i have forum in /forum directory and i have placed the following code in the .htaccess file which is placed in forum directory itself...the problem is that whenever we click any forum say in index page we have three forums and we click on any one ...the link would be like this
forum-1.html but would return back to the index page...whats is wrong with this
Thanks in advance
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]