| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| NamePros Member Join Date: Jul 2007
Posts: 56
![]() | Mod Rewrite Hey guys, came accross a small problem. I have set up my phpBB forum with mod rewrite, all works fine, apart from, whenever i go to, http://myforum.url/forum_name/ it redirects fine, but then changes the url back to http://myforum.ul/viewforum.php?f=4 Is there any way to keep this page as the /forum_name/ instead of viewforum.php?f=4 Any help would be much appreciated |
| |
| | #2 (permalink) |
| NamePros Member Join Date: Mar 2007 Location: Finland
Posts: 29
![]() | Can you show your rewrite rule - you need to have [L] in there somewhere, but easier to comment if you post the relevant rewrite snippet.
__________________ Regards Jamie Let the might of your compassion arise to bring a quick end to the flowing stream of the blood and tears ..... Please hear my anguished words of truth. |
| |
| | THREAD STARTER #4 (permalink) |
| NamePros Member Join Date: Jul 2007
Posts: 56
![]() | Code: # FORUM INDEX
RewriteRule ^forum\.html$ /bbs/index.php [QSA,L,NC]
# FORUM
RewriteRule ^[a-z0-9_-]*-f([0-9]+)/?(page([0-9]+)\.html)?$ /bbs/viewforum.php?f=$1&start=$3 [QSA,L,NC]
# TOPIC WITH VIRTUAL FOLDER
RewriteRule ^[a-z0-9_-]*-f([0-9]+)/[a-z0-9_-]*-t([0-9]+)(-([0-9]+))?\.html$ /bbs/viewtopic.php?f=$1&t=$2&start=$4 [QSA,L,NC]
# GLOBAL ANNOUNCES WITH VIRTUAL FOLDER
RewriteRule ^announces/[a-z0-9_-]*-t([0-9]+)(-([0-9]+))?\.html$ /bbs/viewtopic.php?t=$1&start=$3 [QSA,L,NC]
# TOPIC WITHOUT FORUM ID & DELIM
RewriteRule ^([a-z0-9_-]*)/?[a-z0-9_-]*-t([0-9]+)(-([0-9]+))?\.html$ /bbs/viewtopic.php?forum_uri=$1&t=$2&start=$4 [QSA,L,NC]
# PROFILES ADVANCED
RewriteRule ^[a-z0-9_-]*-u([0-9]+)/$ /bbs/memberlist.php?mode=viewprofile&u=$1 [QSA,L,NC]
# USER MESSAGES ADVANCED
RewriteRule ^[a-z0-9_-]*-u([0-9]+)/(topics|posts)/?(page([0-9]+)\.html)?$ /bbs/search.php?author_id=$1&sr=$2&start=$4 [QSA,L,NC]
# GROUPS ADVANCED
RewriteRule ^[a-z0-9_-]*-g([0-9]+)(-([0-9]+))?\.html$ /bbs/memberlist.php?mode=group&g=$1&start=$3 [QSA,L,NC]
# POST
RewriteRule ^post([0-9]+)\.html$ /bbs/viewtopic.php?p=$1 [QSA,L,NC]
# ACTIVE TOPICS
RewriteRule ^active-topics(-([0-9]+))?\.html$ /bbs/search.php?search_id=active_topics&start=$2&sr=topics [QSA,L,NC]
# UNANSWERED TOPICS
RewriteRule ^unanswered(-([0-9]+))?\.html$ /bbs/search.php?search_id=unanswered&start=$2&sr=topics [QSA,L,NC]
# NEW POSTS
RewriteRule ^newposts(-([0-9]+))?\.html$ /bbs/search.php?search_id=newposts&start=$2&sr=topics [QSA,L,NC]
# THE TEAM
RewriteRule ^the-team\.html$ /bbs/memberlist.php?mode=leaders [QSA,L,NC]
# HERE IS A GOOD PLACE TO ADD OTHER PHPBB RELATED REWRITERULES
# FORUM WITHOUT ID & DELIM
# THESE THREE LINES MUST BE LOCATED AT THE END OF YOUR HTACCESS TO WORK PROPERLY
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z0-9_-]+)/?(page([0-9]+)\.html)?$ /bbs/viewforum.php?forum_uri=$1&start=$3 [QSA,L,NC]
# END PHPBB PAGES ????: NamePros.com http://www.namepros.com/programming/517919-mod-rewrite.html Thats the code I have so far. seems to have the [L] tags already. Any other ideas? ![]() thanks |
| |