/
user.htaccess
43 lines (35 loc) · 1.42 KB
/
user.htaccess
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Instant Picture Creator
# .htaccess
#
# @author Michael Haschke @ eye48.com
# @version $Id: $
# please replace every '/path/to/instantpicture.php' by
# the location of instantpicture.php on your server
# what image type are wrapped by Instant Picture
# Example: <FilesMatch "\.(png|PNG)"> (only for Portable Network Graphics) )
<FilesMatch "\.(gif|jpg|jpeg|png|GIF|JPG|JPEG|PNG)">
<IfModule mod_rewrite.c>
# try to use Apache's Rewrite module
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule . /path/to/instantpicture.php?picture=%{REQUEST_URI}?%{QUERY_STRING}
</IfModule>
<IfModule !mod_rewrite.c>
# Rewrite module is not available, fallback to AddType/AddHandler and Action
<IfModule mod_mime.c>
<IfModule mod_actions.c>
AddType application/x-httpd-parse .jpg .JPG .jpeg .JPEG .gif .GIF .png .PNG
# sometimes AddType don't work but AddHandler does
# in this case uncomment the AddHandler line and comment out the AddType line
#AddHandler application/x-httpd-parse .jpg .JPG .jpeg .JPEG .gif .GIF .png .PNG
Action application/x-httpd-parse "/path/to/instantpicture.php?picture="
</IfModule>
</IfModule>
<IfModule !mod_mime.c>
# neither Rewrite nor AddType/Action works, fallback to Redirect (Apache's Alias module)
<IfModule mod_alias.c>
RedirectMatch temp "^(.*)$" http://yourserver.com/path/to/instantpicture.php$1
</IfModule>
</IfModule>
</IfModule>
</FilesMatch>