Differences from version 2 to 5



@@ -3,37 +3,84 @@

 For User and Wiki links, this feature adds a '/view' tag into the generated URLs.
 
 Normal URL:
-{code()}
+{CODE source='XML'}
 http://www.bitweaver.org/wiki/index.php?page=LDAPCompatibility
-{code}
+{/CODE}
 
 When ((PrettyUrls)) is enabled:
-{code()}
+{CODE source='XML'}
 http://www.bitweaver.org/wiki/LDAPCompatibility
-{code}
+{/CODE}
 
 When FeaturePrettyUrlsExtended is enabled:
-{code()}
+{CODE source='XML'}
 http://www.bitweaver.org/wiki/view/LDAPCompatibility
-{code}
+{/CODE}
 
 Enabling this feature will require manually editing the default .htaccess files.
 
 The exact changes will depend on your web server configuration.
 
 Example for wiki/.htaccess
-{code()}
+{CODE source='Apache'}
 <IfModule mod_rewrite.c>
  RewriteEngine on
-# RewriteBase /wiki/
- RewriteCond %{SCRIPT_FILENAME} -f [OR]
- RewriteCond %{SCRIPT_FILENAME}/index.php -f
- RewriteRule ^(.*)$ - [L]
-
- RewriteRule view/(.*)$ index.php?page=$1 [L]
+ RewriteBase /wiki/
+ RewriteCond %{SCRIPT_FILENAME} -f [OR]
+ RewriteCond %{SCRIPT_FILENAME}/index.php -f
+ RewriteRule ^(.*)$ - [L]
+ RewriteRule view/(.*)$ index.php?page=$1 [L]
 </IfModule>
-{code}
+{/CODE}
 
+Or, you can incorporate all the necessary rewrites into your main Apache configuration:
+{CODE source='Apache'}
+<IfModule mod_rewrite.c>
+ RewriteEngine on
+ #RewriteLog /var/log/httpd/rewrite.log
+ #RewriteLogLevel 2
+
+ # If the URL points to a file that exists, don't rewrite.
+ RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} -f [OR]
+ RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME}/index.php -f [OR]
+ RewriteCond %{REQUEST_FILENAME} -f [OR]
+ RewriteCond %{REQUEST_FILENAME}/index.php -f
+ RewriteRule ^.*$ - [L]
+
+ RewriteRule ^/fisheye/image/([0-9]+)(/[0-9/]+)*/?([A-Za-z]+)*$ /fisheye/view_image.php?image_id=$1&gallery_path=$2&size=$3 [L,QSA]
+ RewriteRule ^/fisheye/gallery([0-9/]+)*/([0-9]+)/?$ /fisheye/view.php?gallery_id=$2&gallery_path=$1 [L,QSA]
+ RewriteRule ^/users/view/([A-Za-z0-9_]+.*)$ /users/index.php?home=$1 [L,QSA]
+ RewriteRule ^/users/([A-Za-z0-9_]+.*)$ /users/index.php?home=$1 [L,QSA]
+ RewriteRule ^/wiki/view/(.+)$ /wiki/index.php?page=$1 [L]
+ RewriteRule ^/wiki/(.+)$ /wiki/index.php?page=$1 [L]
+ RewriteRule ^/articles/([0-9]+.*)$ /articles/read.php?article_id=$1 [L]
+ RewriteRule ^/blogs/view/content/([0-9]+.*)$ /blogs/view_post.php?content_id=$1 [L]
+ RewriteRule ^/blogs/post/([0-9]+.*)$ /blogs/view_post.php?post_id=$1 [L]
+ RewriteRule ^/blogs/([0-9]+.*)$ /blogs/view.php?blog_id=$1 [L]
+ RewriteRule ^/pigeonholes/(.+)$ /pigeonholes/index.php?content_id=$1 [L]
+
+ # Defend against possible future exploits: http://www.phpbb.com/phpBB/viewtopic.php?t=308605 and http://www.phpbb.com/phpBB/viewtopic.php?p=1368328#1368328
+ RewriteCond %{QUERY_STRING} ^(.*)\.printf\( [OR]
+ RewriteCond %{QUERY_STRING} ^(.*)wget\%20 [OR]
+ RewriteCond %{QUERY_STRING} ^(.*)echr(.*) [OR]
+ RewriteCond %{QUERY_STRING} ^(.*)esystem(.*) [OR]
+ RewriteCond %{QUERY_STRING} ^(.*)highlight=\%2527 [OR]
+ RewriteCond %{QUERY_STRING} ^(.*)highlight=' [OR]
+ RewriteCond %{HTTP_COOKIE}% s:(.*):\%22test1\%22\%3b
+ RewriteRule ^.*$ http://127.0.0.1/ [L,F]
+
+ RewriteCond %{HTTP_REFERER} (texas\-hold\-em|e\-site|viagra|casino|poker|holdem|pharmacy|e\-buy|cialis|pills)(.*)\.(com|net|org|us|info|biz) [NC,OR]
+ RewriteCond %{HTTP_REFERER} \.(com|net|org|us|info|biz)\/(online\-poker|texas-holdem|poker|empire\-poker|poker\-rooms)\.html$ [NC,OR]
+ RewriteCond %{HTTP_REFERER} ^http://www.andrewsaluk.com/.*$ [NC,OR]
+ RewriteCond %{HTTP_REFERER} \.(com|net|org|us|info|biz)\/.*(equity|mortgage|consolidation|loan).*\.html$ [NC]
+ RewriteRule ^.*$ http://127.0.0.1/ [L,F]
+
+ # fake out phpBB user profile page
+ RewriteCond %{REQUEST_URI} profile.php
+ RewriteCond %{QUERY_STRING} .*mode=viewprofile.*u=([0-9]*)
+ RewriteRule .* /users/index.php?fHomepage=%1 [R,env=VV_THEME:people,QSA]
+</IfModule>
+{/CODE}
 
 !!See Also
 * ((PrettyUrls))
Page History
Date/CommentUserIPVersion
30 Jun 2008 (09:17 UTC)
Kozuch85.207.244.1605
Current • Source
KainX12.203.189.343
View • Compare • Difference • Source
James Thompson64.65.89.2272
View • Compare • Difference • Source