source: trunk/forum/.htaccess @ 1596

Revision 1596, 4.1 KB checked in by Gongwei.Yu, 2 years ago (diff)
Line 
1
2
3    # Lines That should already be in your .htacess
4    <Files "config.php">
5    Order Allow,Deny
6    Deny from All
7    </Files>
8    <Files "common.php">
9    Order Allow,Deny
10    Deny from All
11    </Files>
12
13    # You may need to un-comment the following lines
14    # Options +FollowSymlinks
15    # To make sure that rewritten dir or file (/|.html) will not load dir.php in case it exist
16    # Options -MultiViews
17    # REMEBER YOU ONLY NEED TO STARD MOD REWRITE ONCE
18    RewriteEngine On
19    # Uncomment the statement below if you want to make use of
20    # HTTP authentication and it does not already work.
21    # This could be required if you are for example using PHP via Apache CGI.
22    # RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
23    # REWRITE BASE
24    RewriteBase /forum/
25    # HERE IS A GOOD PLACE TO FORCE CANONICAL DOMAIN
26    # RewriteCond %{HTTP_HOST} !^localhost:8080$ [NC]
27    # RewriteRule ^(.*)$ http://localhost:8080/forum/$1 [QSA,L,R=301]
28
29    # DO NOT GO FURTHER IF THE REQUESTED FILE / DIR DOES EXISTS
30    RewriteCond %{REQUEST_FILENAME} -f
31    RewriteCond %{REQUEST_FILENAME} -d
32    RewriteRule . - [L]
33    #####################################################
34    # PHPBB SEO REWRITE RULES ALL MODES
35    #####################################################
36    # AUTHOR : dcz www.phpbb-seo.com
37    # STARTED : 01/2006
38    #################################
39    # FORUMS PAGES
40    ###############
41    # FORUM INDEX REWRITERULE WOULD STAND HERE IF USED. "forum" REQUIRES TO BE SET AS FORUM INDEX
42    # RewriteRule ^forum\.html$ index.php [QSA,L,NC]
43    # FORUM ALL MODES
44    RewriteRule ^(forum|[a-z0-9_-]*-f)([0-9]+)/?(page([0-9]+)\.html)?$ viewforum.php?f=$2&start=$4 [QSA,L,NC]
45    # TOPIC WITH VIRTUAL FOLDER ALL MODES
46    RewriteRule ^(forum|[a-z0-9_-]*-f)([0-9]+)/(topic|[a-z0-9_-]*-t)([0-9]+)(-([0-9]+))?\.html$ viewtopic.php?f=$2&t=$4&start=$6 [QSA,L,NC]
47    # GLOBAL ANNOUNCES WITH VIRTUAL FOLDER ALL MODES
48    RewriteRule ^announces/(topic|[a-z0-9_-]*-t)([0-9]+)(-([0-9]+))?\.html$ viewtopic.php?t=$2&start=$4 [QSA,L,NC]
49    # TOPIC WITHOUT FORUM ID & DELIM ALL MODES
50    RewriteRule ^([a-z0-9_-]*)/?(topic|[a-z0-9_-]*-t)([0-9]+)(-([0-9]+))?\.html$ viewtopic.php?forum_uri=$1&t=$3&start=$5 [QSA,L,NC]
51    # PHPBB FILES ALL MODES
52    RewriteRule ^resources/[a-z0-9_-]+/(thumb/)?([0-9]+)$ download/file.php?id=$2&t=$1 [QSA,L,NC]
53    # PROFILES ALL MODES WITH ID
54    RewriteRule ^(member|[a-z0-9_-]*-u)([0-9]+)/$ memberlist.php?mode=viewprofile&u=$2 [QSA,L,NC]
55    # USER MESSAGES ALL MODES WITH ID
56    RewriteRule ^(member|[a-z0-9_-]*-u)([0-9]+)/(topics|posts)/?(page([0-9]+)\.html)?$ search.php?author_id=$2&sr=$3&start=$5 [QSA,L,NC]
57    # GROUPS ALL MODES
58    RewriteRule ^(group|[a-z0-9_-]*-g)([0-9]+)(-([0-9]+))?\.html$ memberlist.php?mode=group&g=$2&start=$4 [QSA,L,NC]
59    # POST
60    RewriteRule ^post([0-9]+)\.html$ viewtopic.php?p=$1 [QSA,L,NC]
61    # ACTIVE TOPICS
62    RewriteRule ^active-topics(-([0-9]+))?\.html$ search.php?search_id=active_topics&start=$2&sr=topics [QSA,L,NC]
63    # UNANSWERED TOPICS
64    RewriteRule ^unanswered(-([0-9]+))?\.html$ search.php?search_id=unanswered&start=$2&sr=topics [QSA,L,NC]
65    # NEW POSTS
66    RewriteRule ^newposts(-([0-9]+))?\.html$ search.php?search_id=newposts&start=$2&sr=topics [QSA,L,NC]
67    # UNREAD POSTS
68    RewriteRule ^unreadposts(-([0-9]+))?\.html$ search.php?search_id=unreadposts&start=$2 [QSA,L,NC]
69    # THE TEAM
70    RewriteRule ^the-team\.html$ memberlist.php?mode=leaders [QSA,L,NC]
71    # HERE IS A GOOD PLACE TO ADD OTHER PHPBB RELATED REWRITERULES
72
73    # FORUM WITHOUT ID & DELIM ALL MODES (SAME DELIM)
74    # THESE THREE LINES MUST BE LOCATED AT THE END OF YOUR HTACCESS TO WORK PROPERLY
75    RewriteCond %{REQUEST_FILENAME} !-f
76    RewriteCond %{REQUEST_FILENAME} !-d
77    RewriteRule ^([a-z0-9_-]+)/?(page([0-9]+)\.html)?$ viewforum.php?forum_uri=$1&start=$3 [QSA,L,NC]
78    # FIX RELATIVE PATHS : FILES
79    RewriteRule ^.+/(style\.php|ucp\.php|mcp\.php|faq\.php|download/file.php)$ $1 [QSA,L,NC,R=301]
80    # FIX RELATIVE PATHS : IMAGES
81    RewriteRule ^.+/(styles/.*|images/.*)/$ $1 [QSA,L,NC,R=301]
82    # END PHPBB PAGES
83    #####################################################
84
Note: See TracBrowser for help on using the repository browser.