| 1 |
<IfModule !mod_rewrite.c> |
|---|
| 2 |
# ugly ugly hack to detect missing mod_rewrite |
|---|
| 3 |
# RedirectMatch must be to an absolute destination, so forces 500 error... |
|---|
| 4 |
ErrorDocument 500 "Elgg error: Apache does not have mod_rewrite loaded. Please check your apache setup." |
|---|
| 5 |
RedirectMatch 302 .* index.php |
|---|
| 6 |
</IfModule> |
|---|
| 7 |
|
|---|
| 8 |
<Files "htaccess-dist"> |
|---|
| 9 |
order allow,deny |
|---|
| 10 |
deny from all |
|---|
| 11 |
</Files> |
|---|
| 12 |
|
|---|
| 13 |
# Don't listing directory |
|---|
| 14 |
Options -Indexes |
|---|
| 15 |
|
|---|
| 16 |
# Follow symbolic links |
|---|
| 17 |
Options +FollowSymLinks |
|---|
| 18 |
|
|---|
| 19 |
# Default handler |
|---|
| 20 |
DirectoryIndex index.php |
|---|
| 21 |
|
|---|
| 22 |
# php 4, apache 1.x |
|---|
| 23 |
<IfModule mod_php4.c> |
|---|
| 24 |
# default memory limit to 16Mb |
|---|
| 25 |
php_value memory_limit 16777216 |
|---|
| 26 |
# to make sure register global is off |
|---|
| 27 |
php_value register_globals 0 |
|---|
| 28 |
# max post size to 8Mb |
|---|
| 29 |
php_value post_max_size 8388608 |
|---|
| 30 |
# upload size limit to 5Mb |
|---|
| 31 |
php_value upload_max_filesize 5242880 |
|---|
| 32 |
# hide errors, enable only if debug enabled |
|---|
| 33 |
php_value display_errors 0 |
|---|
| 34 |
</IfModule> |
|---|
| 35 |
|
|---|
| 36 |
# php 4, apache 2 |
|---|
| 37 |
<IfModule sapi_apache2.c> |
|---|
| 38 |
# default memory limit to 16Mb |
|---|
| 39 |
php_value memory_limit 16777216 |
|---|
| 40 |
# to make sure register global is off |
|---|
| 41 |
php_value register_globals 0 |
|---|
| 42 |
# max post size to 8Mb |
|---|
| 43 |
php_value post_max_size 8388608 |
|---|
| 44 |
# upload size limit to 5Mb |
|---|
| 45 |
php_value upload_max_filesize 5242880 |
|---|
| 46 |
# hide errors, enable only if debug enabled |
|---|
| 47 |
php_value display_errors 0 |
|---|
| 48 |
</IfModule> |
|---|
| 49 |
|
|---|
| 50 |
# php 5, apache 1 and 2 |
|---|
| 51 |
<IfModule mod_php5.c> |
|---|
| 52 |
# default memory limit to 16Mb |
|---|
| 53 |
php_value memory_limit 16777216 |
|---|
| 54 |
# to make sure register global is off |
|---|
| 55 |
php_value register_globals 0 |
|---|
| 56 |
# max post size to 8Mb |
|---|
| 57 |
php_value post_max_size 8388608 |
|---|
| 58 |
# upload size limit to 5Mb |
|---|
| 59 |
php_value upload_max_filesize 5242880 |
|---|
| 60 |
# hide errors, enable only if debug enabled |
|---|
| 61 |
php_value display_errors 0 |
|---|
| 62 |
</IfModule> |
|---|
| 63 |
|
|---|
| 64 |
<IfModule mod_rewrite.c> |
|---|
| 65 |
|
|---|
| 66 |
RewriteEngine on |
|---|
| 67 |
|
|---|
| 68 |
# If Elgg is in a subdirectory on your site, you might need to add a RewriteBase line |
|---|
| 69 |
# containing the path from your site root to elgg's root. e.g. If your site is |
|---|
| 70 |
# http://example.com/ and Elgg is in http://example.com/sites/elgg/, you might need |
|---|
| 71 |
# |
|---|
| 72 |
#RewriteBase /sites/elgg/ |
|---|
| 73 |
# |
|---|
| 74 |
# here, only without the # in front. |
|---|
| 75 |
# |
|---|
| 76 |
# If you're not running Elgg in a subdirectory on your site, but still getting lots |
|---|
| 77 |
# of 404 errors beyond the front page, you could instead try: |
|---|
| 78 |
# |
|---|
| 79 |
#RewriteBase / |
|---|
| 80 |
|
|---|
| 81 |
# Pages |
|---|
| 82 |
########### |
|---|
| 83 |
RewriteRule ^content\/?(.*)?$ mod/pages/index.php?owner=-1&page=$1 [QSA,L] |
|---|
| 84 |
RewriteRule ^([A-Za-z0-9]+)\/content\/(.*)?$ mod/pages/index.php?profile_name=$1&page=$2 [QSA,L] |
|---|
| 85 |
|
|---|
| 86 |
RewriteRule ^_templates(\/)?$ mod/template/index.php?%{QUERY_STRING} |
|---|
| 87 |
RewriteRule ^_templates\/edit.php$ mod/template/edit.php?%{QUERY_STRING} |
|---|
| 88 |
RewriteRule ^_templates\/preview.php$ mod/template/preview.php?%{QUERY_STRING} |
|---|
| 89 |
RewriteRule ^_templates/css/(.+)$ mod/template/css.php?template=$1 |
|---|
| 90 |
|
|---|
| 91 |
RewriteRule ^(.+)\/rssstyles.xsl$ mod/newsclient/styles.php?rssurl=$1&url=$1 |
|---|
| 92 |
|
|---|
| 93 |
RewriteRule ^([A-Za-z0-9]+)\/dashboard(\/)?$ mod/adash/index.php?user=$1 |
|---|
| 94 |
|
|---|
| 95 |
RewriteRule ^([A-Za-z0-9]+)\/profile(\/)?$ profile/index.php?profile_name=$1 |
|---|
| 96 |
RewriteRule ^([A-Za-z0-9]+)\/tags(\/)?$ search/personaltags.php?profile_name=$1 |
|---|
| 97 |
RewriteRule ^([A-Za-z0-9]+)\/rss\/(.+)\/?$ profile/rss2.php?profile_name=$1&tag=$2 |
|---|
| 98 |
|
|---|
| 99 |
# Invite |
|---|
| 100 |
######### |
|---|
| 101 |
RewriteRule ^invite\/$ mod/invite/index.php |
|---|
| 102 |
ReWriteRule ^invite\/join\/([A-Za-z0-9]+)$ mod/invite/join.php?invitecode=$1 |
|---|
| 103 |
ReWriteRule ^register$ mod/invite/register.php |
|---|
| 104 |
RewriteRule ^forgottenpassword$ mod/invite/forgotten_password.php |
|---|
| 105 |
RewriteRule ^newpassword\/([A-Za-z0-9]+)$ mod/invite/new_password.php?passwordcode=$1 |
|---|
| 106 |
|
|---|
| 107 |
RewriteRule ^([A-Za-z0-9]+)(\/)?$ profile/index.php?profile_name=$1 |
|---|
| 108 |
|
|---|
| 109 |
# Activity |
|---|
| 110 |
########### |
|---|
| 111 |
RewriteRule ^_activity\/$ mod/activity/index.php |
|---|
| 112 |
RewriteRule ^_activity\/index.php$ mod/activity/index.php?%{QUERY_STRING} |
|---|
| 113 |
|
|---|
| 114 |
# Communities |
|---|
| 115 |
############## |
|---|
| 116 |
RewriteRule ^([A-Za-z0-9]+)\/communities\/?$ mod/community/index.php?friends_name=$1 |
|---|
| 117 |
RewriteRule ^([A-Za-z0-9]+)\/communities\/owned$ mod/community/owned.php?profile_name=$1 |
|---|
| 118 |
RewriteRule ^([A-Za-z0-9]+)\/communities\/new$ mod/community/new.php?profile_name=$1 |
|---|
| 119 |
RewriteRule ^([A-Za-z0-9]+)\/community\/delete$ mod/community/index.php?profile_name=$1&action=community:delete |
|---|
| 120 |
RewriteRule ^([A-Za-z0-9]+)\/community\/requests$ mod/community/requests.php?profile_name=$1 |
|---|
| 121 |
RewriteRule ^([A-Za-z0-9]+)\/community\/requests\/aprove\/([0-9]+)$ mod/community/requests.php?profile_name=$1&action=community:approve:request&request_id=$2 |
|---|
| 122 |
RewriteRule ^([A-Za-z0-9]+)\/community\/requests\/decline\/([0-9]+)$ mod/community/requests.php?profile_name=$1&action=community:decline:request&request_id=$2 |
|---|
| 123 |
RewriteRule ^([A-Za-z0-9]+)\/community\/members$ mod/community/members.php?profile_name=$1 |
|---|
| 124 |
RewriteRule ^([A-Za-z0-9]+)\/community\/add\/([0-9]+)$ mod/community/index.php?friends_name=$1&friend_id=$2&action=friend |
|---|
| 125 |
RewriteRule ^([A-Za-z0-9]+)\/community\/leave\/([0-9]+)$ mod/community/index.php?profile_name=$1&friend_id=$2&action=leave |
|---|
| 126 |
RewriteRule ^([A-Za-z0-9]+)\/community\/separate\/([0-9]+)$ mod/community/members.php?profile_name=$1&friend_id=$2&action=separate |
|---|
| 127 |
RewriteRule ^community\/([0-9]+)\/?$ mod/communities/community.php?community_id=$1 |
|---|
| 128 |
RewriteRule ^([A-Za-z0-9]+)\/community\/invite$ mod/community/invite.php?profile_name=$1 |
|---|
| 129 |
RewriteRule ^([A-Za-z0-9]+)\/communities\/invitations$ mod/community/user_community_invitations.php?profile_name=$1 |
|---|
| 130 |
|
|---|
| 131 |
# Files |
|---|
| 132 |
######## |
|---|
| 133 |
RewriteRule ^([A-Za-z0-9]+)\/files\/?$ mod/file/index.php?files_name=$1 |
|---|
| 134 |
RewriteRule ^([A-Za-z0-9]+)\/files\/([0-9]+)\/?$ mod/file/index.php?files_name=$1&folder=$2 |
|---|
| 135 |
RewriteRule ^([A-Za-z0-9]+)\/files\/([0-9\-]+)\/([0-9]+)\/(.+)$ mod/file/download.php?files_name=$1&folder=$2&filename=$4&id=$3 |
|---|
| 136 |
RewriteRule ^(([A-Za-z0-9])[A-Za-z0-9]+)\/files\/rss\/?$ mod/newsclient/static.php?username=$1&userref=$2&type=files |
|---|
| 137 |
RewriteRule ^([A-Za-z0-9]+)\/files\/rss\/(.+)\/?$ mod/file/rss2.php?files_name=$1&tag=$2 |
|---|
| 138 |
RewriteRule ^_icon\/file/([-0-9]+)$ mod/file/icon.php?id=$1 |
|---|
| 139 |
RewriteRule ^_files\/icon.php$ mod/file/icon.php?%{QUERY_STRING} |
|---|
| 140 |
|
|---|
| 141 |
# Friends |
|---|
| 142 |
########## |
|---|
| 143 |
RewriteRule ^([A-Za-z0-9]+)\/friends\/?$ mod/friend/index.php?friends_name=$1 |
|---|
| 144 |
RewriteRule ^([A-Za-z0-9]+)\/friendsof\/?$ mod/friend/friendsof.php?friends_name=$1 |
|---|
| 145 |
RewriteRule ^([A-Za-z0-9]+)\/friends\/requests?$ mod/friend/requests.php?friends_name=$1 |
|---|
| 146 |
RewriteRule ^([A-Za-z0-9]+)\/foaf\/?$ mod/friend/foaf.php?friends_name=$1 |
|---|
| 147 |
|
|---|
| 148 |
# Icons |
|---|
| 149 |
######## |
|---|
| 150 |
RewriteRule ^_icons\/$ mod/icons/index.php |
|---|
| 151 |
RewriteRule ^_icon\/user/([-0-9]+)$ mod/icons/icon.php?id=$1 |
|---|
| 152 |
RewriteRule ^_icon\/user/([-0-9]+)\/([A-Za-z])\/([0-9]+)$ mod/icons/icon.php?id=$1&constraint1=$2&size1=$3 |
|---|
| 153 |
RewriteRule ^_icon\/user/([-0-9]+)\/([A-Za-z])\/([0-9]+)\/([A-Za-z])\/([0-9]+)$ mod/icons/icon.php?id=$1&constraint1=$2&size1=$3&constraint2=$4&size2=$5 |
|---|
| 154 |
|
|---|
| 155 |
# Newsclient |
|---|
| 156 |
############ |
|---|
| 157 |
RewriteRule ^(([A-Za-z0-9])[A-Za-z0-9]+)\/rss\/?$ mod/newsclient/static.php?username=$1&userref=$2&type=profile |
|---|
| 158 |
RewriteRule ^([A-Za-z0-9]+)\/newsclient\/?$ mod/newsclient/subscriptions.php?profile_name=$1 |
|---|
| 159 |
RewriteRule ^([A-Za-z0-9]+)\/newsclient\/all\/?$ mod/newsclient/index.php?profile_name=$1 |
|---|
| 160 |
RewriteRule ^([A-Za-z0-9]+)\/newsclient\/all\/skip=([0-9]+)$ mod/newsclient/index.php?profile_name=$1&feed_offset=$2 |
|---|
| 161 |
RewriteRule ^([A-Za-z0-9]+)\/feeds\/?$ mod/newsclient/subscriptions.php?profile_name=$1 |
|---|
| 162 |
RewriteRule ^([A-Za-z0-9]+)\/feeds\/all\/?$ mod/newsclient/index.php?profile_name=$1 |
|---|
| 163 |
RewriteRule ^([A-Za-z0-9]+)\/feeds\/all\/skip=([0-9]+)$ mod/newsclient/index.php?profile_name=$1&feed_offset=$2 |
|---|
| 164 |
RewriteRule ^_rss\/([A-Za-z_]+).php$ mod/newsclient/$1.php?%{QUERY_STRING} |
|---|
| 165 |
|
|---|
| 166 |
# Users |
|---|
| 167 |
######## |
|---|
| 168 |
RewriteRule ^_userdetails\/$ mod/users/index.php?%{QUERY_STRING} |
|---|
| 169 |
RewriteRule ^_userdetails\/index.php$ mod/users/index.php?%{QUERY_STRING} |
|---|
| 170 |
|
|---|
| 171 |
# Weblog |
|---|
| 172 |
######## |
|---|
| 173 |
RewriteRule ^([A-Za-z0-9]+)\/weblog\/?$ mod/blog/index.php?weblog_name=$1 |
|---|
| 174 |
ReWriteRule ^([A-Za-z0-9]+)\/weblog\/skip=([0-9]+)$ mod/blog/index.php?weblog_name=$1&weblog_offset=$2 |
|---|
| 175 |
RewriteRule ^([A-Za-z0-9]+)\/weblog\/edit$ mod/blog/edit.php?profile_name=$1 |
|---|
| 176 |
RewriteRule ^([A-Za-z0-9]+)\/weblog\/edit\/([0-9]+)$ mod/blog/edit.php?profile_name=$1&weblog_post_id=$2&action=edit |
|---|
| 177 |
RewriteRule ^([A-Za-z0-9]+)\/weblog\/archive\/?$ mod/blog/archive.php?weblog_name=$1 |
|---|
| 178 |
RewriteRule ^([A-Za-z0-9]+)\/weblog\/archive\/([0-9]+)\/([0-9]+)\/?$ mod/blog/archive_month.php?weblog_name=$1&year=$2&month=$3 |
|---|
| 179 |
RewriteRule ^([A-Za-z0-9]+)\/weblog\/friends\/?$ mod/blog/friends.php?weblog_name=$1 |
|---|
| 180 |
ReWriteRule ^([A-Za-z0-9]+)\/weblog\/friends\/skip=([0-9]+)$ mod/blog/friends.php?weblog_name=$1&weblog_offset=$2 |
|---|
| 181 |
RewriteRule ^([A-Za-z0-9]+)\/weblog\/interesting\/?$ mod/blog/interesting.php?weblog_name=$1 |
|---|
| 182 |
ReWriteRule ^([A-Za-z0-9]+)\/weblog\/interesting\/skip=([0-9]+)$ mod/blog/interesting.php?weblog_name=$1&weblog_offset=$2 |
|---|
| 183 |
RewriteRule ^[A-Za-z0-9]+\/weblog\/([0-9]+)\.html$ mod/blog/view_post.php?post=$1 |
|---|
| 184 |
RewriteRule ^[A-Za-z0-9]+\/weblog\/([0-9]+)\.html.([0-9]+)$ mod/log/view_post.php?post=$1&commentpage=$2 |
|---|
| 185 |
RewriteRule ^([A-Za-z0-9]+)\/weblog\/rss\/(.+)\/?$ mod/blog/rss2.php?weblog_name=$1&tag=$2&modifier=is |
|---|
| 186 |
RewriteRule ^([A-Za-z0-9]+)\/weblog\/rssnot\/(.+)\/?$ mod/blog/rss2.php?weblog_name=$1&tag=$2&modifier=not |
|---|
| 187 |
RewriteRule ^(([A-Za-z0-9])[A-Za-z0-9]+)\/weblog\/rss\/?$ mod/newsclient/static.php?username=$1&userref=$2&type=weblog |
|---|
| 188 |
RewriteRule ^([A-Za-z0-9]+)\/weblog\/category\/([^\/]+)\/?$ mod/blog/index.php?weblog_name=$1&filter=$2 |
|---|
| 189 |
ReWriteRule ^([A-Za-z0-9]+)\/weblog\/category\/([^\/]+)\/skip=([0-9]+)$ mod/blog/index.php?weblog_name=$1&filter=$2&weblog_offset=$3 |
|---|
| 190 |
ReWriteRule ^weblog\/everyone$ mod/blog/everyone.php |
|---|
| 191 |
ReWriteRule ^weblog\/everyone\/(people|communities|commented|uncommented)$ mod/blog/everyone.php?filter=$1 |
|---|
| 192 |
ReWriteRule ^weblog\/everyone\/skip/([0-9]+)$ mod/blog/everyone.php?weblog_offset=$1 |
|---|
| 193 |
|
|---|
| 194 |
|
|---|
| 195 |
########### |
|---|
| 196 |
|
|---|
| 197 |
RewriteRule ^tag\/(.+)\/?$ search/all.php?tag=$1 |
|---|
| 198 |
RewriteRule ^rsstag\/(.+)\/?$ search/rss.php?tag=$1 |
|---|
| 199 |
RewriteRule ^tag\/(.+)/ecl\/?$ search/ecl.php?tag=$1 |
|---|
| 200 |
|
|---|
| 201 |
# Some blogging clients probe Wordpress or MoveableType endpoints, |
|---|
| 202 |
# redirect them to the Elgg xml-rpc endpoint |
|---|
| 203 |
# |
|---|
| 204 |
RewriteRule xml-rpc.php _rpc/RPC2.php |
|---|
| 205 |
RewriteRule mt/mt-xmlrpc.cgi _rpc/RPC2.php |
|---|
| 206 |
|
|---|
| 207 |
# Rewrite rules for rpc transition to mod/ in v0.9+ so we don't break things |
|---|
| 208 |
# |
|---|
| 209 |
RewriteRule ^_rpc/RPC2.php$ mod/rpc/RPC2.php |
|---|
| 210 |
RewriteRule ^_rpc/rsd.php$ mod/rpc/rsd.php?%{QUERY_STRING} |
|---|
| 211 |
|
|---|
| 212 |
</IfModule> |
|---|