fix #136, annoying warnings when is enabled open_basedir or disabled url fopen
[elgg.git] / htaccess-dist
blob9cc50dbbfcadb7142bdd2842f3e2bceb9bdac48e
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>
8 <Files "htaccess-dist">
9     order allow,deny
10     deny from all
11 </Files>
13 Options +FollowSymLinks
15 # Whether to display PHP error messages in page output. Recommended to be off for production systems.
16 # Messages will be logged to Apache's error log regardless.
17 #php_flag display_errors on
19 # PHP defaults to allowing file uploads of max 2MB, below is example option for 5MB.
20 # NB: Adjusting value may not work, depending on other configured php and apache limits.
21 # for more info see http://php.net/manual/en/features.file-upload.php and http://httpd.apache.org/docs/2.0/mod/core.html#limitrequestbody
22 # post_max_size should be slightly larger than upload_max_filesize, but the default is usually 8MB anyway.
23 #php_value post_max_size 8388608
24 #php_value upload_max_filesize 5242880
26 # Elgg can be more of a RAM lover than PHP's default of 8 meg. E.g. 16 meg:
27 php_value memory_limit 16777216
29 # Not really necessary, just to be clean
30 #php_flag short_open_tag off
31 # Forgot that anyone might still have this turned on
32 #php_flag register_globals off
34 <IfModule mod_rewrite.c>
36 RewriteEngine on
38 # If Elgg is in a subdirectory on your site, you might need to add a RewriteBase line
39 # containing the path from your site root to elgg's root. e.g. If your site is
40 # http://example.com/ and Elgg is in http://example.com/sites/elgg/, you might need 
42 #RewriteBase /sites/elgg/
44 # here, only without the # in front.
46 # If you're not running Elgg in a subdirectory on your site, but still getting lots
47 # of 404 errors beyond the front page, you could instead try:
49 #RewriteBase /
51 RewriteRule ^_templates/css/(.+)$ _templates/css.php?template=$1
53 RewriteRule ^(.+)\/rssstyles.xsl$ mod/newsclient/styles.php?rssurl=$1&url=$1
55 RewriteRule ^([A-Za-z0-9]+)\/dashboard(\/)?$ mod/adash/index.php?user=$1
57 RewriteRule ^([A-Za-z0-9]+)\/profile(\/)?$ profile/index.php?profile_name=$1
58 RewriteRule ^([A-Za-z0-9]+)\/tags(\/)?$ search/personaltags.php?profile_name=$1
59 RewriteRule ^([A-Za-z0-9]+)\/rss\/(.+)\/?$ profile/rss2.php?profile_name=$1&tag=$2
61 # Invite
62 #########
63 RewriteRule ^invite\/$ mod/invite/index.php
64 ReWriteRule ^invite\/join\/([A-Za-z0-9]+)$ mod/invite/join.php?invitecode=$1
65 ReWriteRule ^register$ mod/invite/register.php
66 RewriteRule ^forgottenpassword$ mod/invite/forgotten_password.php
67 RewriteRule ^newpassword\/([A-Za-z0-9]+)$ mod/invite/forgotten_password.php?passwordcode=$1
69 RewriteRule ^([A-Za-z0-9]+)(\/)?$ profile/index.php?profile_name=$1
71 # Activity
72 ###########
73 RewriteRule ^_activity\/$ mod/activity/index.php
74 RewriteRule ^_activity\/index.php$ mod/activity/index.php?%{QUERY_STRING}
76 # Communities
77 ##############
78 RewriteRule ^([A-Za-z0-9]+)\/communities\/?$ mod/community/index.php?friends_name=$1
79 RewriteRule ^([A-Za-z0-9]+)\/communities\/owned$ mod/community/owned.php?profile_name=$1
80 RewriteRule ^([A-Za-z0-9]+)\/communities\/new$ mod/community/new.php?profile_name=$1
81 RewriteRule ^([A-Za-z0-9]+)\/community\/delete$ mod/community/index.php?profile_name=$1&action=community:delete
82 RewriteRule ^([A-Za-z0-9]+)\/community\/requests$ mod/community/requests.php?profile_name=$1
83 RewriteRule ^([A-Za-z0-9]+)\/community\/requests\/aprove\/([0-9]+)$ mod/community/requests.php?profile_name=$1&action=community:approve:request&request_id=$2
84 RewriteRule ^([A-Za-z0-9]+)\/community\/requests\/decline\/([0-9]+)$ mod/community/requests.php?profile_name=$1&action=community:decline:request&request_id=$2
85 RewriteRule ^([A-Za-z0-9]+)\/community\/members$ mod/community/members.php?profile_name=$1
86 RewriteRule ^([A-Za-z0-9]+)\/community\/separate\/([0-9]+)$ mod/community/members.php?profile_name=$1&friend_id=$2&action=separate
87 RewriteRule ^community\/([0-9]+)\/?$ mod/communities/community.php?community_id=$1
89 # Files
90 ########
91 RewriteRule ^([A-Za-z0-9]+)\/files\/?$ mod/file/index.php?files_name=$1
92 RewriteRule ^([A-Za-z0-9]+)\/files\/([0-9]+)\/?$ mod/file/index.php?files_name=$1&folder=$2
93 RewriteRule ^([A-Za-z0-9]+)\/files\/([0-9\-]+)\/([0-9]+)\/(.+)$ mod/file/download.php?files_name=$1&folder=$2&filename=$4&id=$3
94 RewriteRule ^([A-Za-z0-9]+)\/files\/rss\/(.+)\/?$ mod/file/rss2.php?files_name=$1&tag=$2
95 RewriteRule ^_icon\/file/([-0-9]+)$ mod/file/icon.php?id=$1
97 # Friends
98 ##########
99 RewriteRule ^([A-Za-z0-9]+)\/friends\/?$ mod/friend/index.php?friends_name=$1
100 RewriteRule ^([A-Za-z0-9]+)\/friendsof\/?$ mod/friend/friendsof.php?friends_name=$1
101 RewriteRule ^([A-Za-z0-9]+)\/friends\/requests?$ mod/friend/requests.php?friends_name=$1
102 RewriteRule ^([A-Za-z0-9]+)\/foaf\/?$ mod/friend/foaf.php?friends_name=$1
104 # Icons
105 ########
106 RewriteRule ^_icons\/$ mod/icons/index.php
107 RewriteRule ^_icon\/user/([-0-9]+)$ mod/icons/icon.php?id=$1
108 RewriteRule ^_icon\/user/([-0-9]+)\/([A-Za-z])\/([0-9]+)$ mod/icons/icon.php?id=$1&constraint1=$2&size1=$3
109 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
111 # Newsclient
112 ############
113 RewriteRule ^(([A-Za-z0-9])[A-Za-z0-9]+)\/rss\/?$ mod/newsclient/static.php?username=$1&userref=$2&type=profile
114 RewriteRule ^([A-Za-z0-9]+)\/newsclient\/?$ mod/newsclient/subscriptions.php?profile_name=$1
115 RewriteRule ^([A-Za-z0-9]+)\/newsclient\/all\/?$ mod/newsclient/index.php?profile_name=$1
116 RewriteRule ^([A-Za-z0-9]+)\/newsclient\/all\/skip=([0-9]+)$ mod/newsclient/index.php?profile_name=$1&feed_offset=$2
117 RewriteRule ^([A-Za-z0-9]+)\/feeds\/?$ mod/newsclient/subscriptions.php?profile_name=$1
118 RewriteRule ^([A-Za-z0-9]+)\/feeds\/all\/?$ mod/newsclient/index.php?profile_name=$1
119 RewriteRule ^([A-Za-z0-9]+)\/feeds\/all\/skip=([0-9]+)$ mod/newsclient/index.php?profile_name=$1&feed_offset=$2
120 RewriteRule ^_rss\/([A-Za-z_]+).php$ mod/newsclient/$1.php?%{QUERY_STRING}
122 # Users
123 ########
124 RewriteRule ^_userdetails\/$ mod/users/index.php?%{QUERY_STRING}
125 RewriteRule ^_userdetails\/index.php$ mod/users/index.php?%{QUERY_STRING}
127 # Weblog
128 ########
129 RewriteRule ^([A-Za-z0-9]+)\/weblog\/?$ mod/blog/index.php?weblog_name=$1
130 ReWriteRule ^([A-Za-z0-9]+)\/weblog\/skip=([0-9]+)$ mod/blog/index.php?weblog_name=$1&weblog_offset=$2
131 RewriteRule ^([A-Za-z0-9]+)\/weblog\/edit$ mod/blog/edit.php?profile_name=$1
132 RewriteRule ^([A-Za-z0-9]+)\/weblog\/edit\/([0-9]+)$ mod/blog/edit.php?profile_name=$1&weblog_post_id=$2&action=edit
133 RewriteRule ^([A-Za-z0-9]+)\/weblog\/archive\/?$ mod/blog/archive.php?weblog_name=$1
134 RewriteRule ^([A-Za-z0-9]+)\/weblog\/archive\/([0-9]+)\/([0-9]+)\/?$ mod/blog/archive_month.php?weblog_name=$1&year=$2&month=$3
135 RewriteRule ^([A-Za-z0-9]+)\/weblog\/friends\/?$ mod/blog/friends.php?weblog_name=$1
136 ReWriteRule ^([A-Za-z0-9]+)\/weblog\/friends\/skip=([0-9]+)$ mod/blog/friends.php?weblog_name=$1&weblog_offset=$2
137 RewriteRule ^([A-Za-z0-9]+)\/weblog\/interesting\/?$ mod/blog/interesting.php?weblog_name=$1
138 ReWriteRule ^([A-Za-z0-9]+)\/weblog\/interesting\/skip=([0-9]+)$ mod/blog/interesting.php?weblog_name=$1&weblog_offset=$2
139 RewriteRule ^[A-Za-z0-9]+\/weblog\/([0-9]+)\.html$ mod/blog/view_post.php?post=$1
140 RewriteRule ^[A-Za-z0-9]+\/weblog\/([0-9]+)\.html.([0-9]+)$ mod/log/view_post.php?post=$1&commentpage=$2
141 RewriteRule ^([A-Za-z0-9]+)\/weblog\/rss\/(.+)\/?$ mod/blog/rss2.php?weblog_name=$1&tag=$2&modifier=is
142 RewriteRule ^([A-Za-z0-9]+)\/weblog\/rssnot\/(.+)\/?$ mod/blog/rss2.php?weblog_name=$1&tag=$2&modifier=not
143 RewriteRule ^(([A-Za-z0-9])[A-Za-z0-9]+)\/weblog\/rss\/?$ mod/newsclient/static.php?username=$1&userref=$2&type=weblog
144 RewriteRule ^([A-Za-z0-9]+)\/weblog\/category\/([^\/]+)\/?$ mod/blog/index.php?weblog_name=$1&filter=$2
145 ReWriteRule ^([A-Za-z0-9]+)\/weblog\/category\/([^\/]+)\/skip=([0-9]+)$ mod/blog/index.php?weblog_name=$1&filter=$2&weblog_offset=$3
146 ReWriteRule ^weblog\/everyone$ mod/blog/everyone.php
147 ReWriteRule ^weblog\/everyone\/(people|communities|commented|uncommented)$ mod/blog/everyone.php?filter=$1
148 ReWriteRule ^weblog\/everyone\/skip/([0-9]+)$ mod/blog/everyone.php?weblog_offset=$1
151 ###########
153 RewriteRule ^tag\/(.+)\/?$ search/all.php?tag=$1
154 RewriteRule ^rsstag\/(.+)\/?$ search/rss.php?tag=$1
155 RewriteRule ^tag\/(.+)/ecl\/?$ search/ecl.php?tag=$1
157 # Some blogging clients probe Wordpress or MoveableType endpoints,
158 # redirect them to the Elgg xml-rpc endpoint
160 RewriteRule xml-rpc.php _rpc/RPC2.php
161 RewriteRule mt/mt-xmlrpc.cgi _rpc/RPC2.php
164 </IfModule>