summaryrefslogtreecommitdiffstats
path: root/htaccess_template
blob: 93e932c420bb77725ba8aa38ab0673b1b1963256 (plain)
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
44
45
46
47
48
49

#    copyright 2012,2013 Arun Persaud <arun@nubati.net>
#
#    This file is part of photo-tags.
#
#    Photo-tags is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    Photo-tags is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with Photo-tags.  If not, see <http://www.gnu.org/licenses/>.

<IfModule mod_rewrite.c>
RewriteEngine on

RewriteBase   /<insert web base url here>

# hide git directory (and others)
RedirectMatch 404 \.(git|cvs|svn|bzr|hg)(/.*|$)

# use autoversioning of js and css files
RewriteRule ^(.*)\.[[:xdigit:]]{32}\.(css|js)$ $1.$2 [L]


### make the url nice and clean; the comments shows an url that should be matched

# web_base/tag/me+berlin/pic/id
RewriteRule tag/([-_\s,a-zA-Z0-9+]*)/pic/([0-9]*) index.php?tag=$1&pic=$2 [L]

# web_base/tag/tag1+tag2/page/4
RewriteRule tag/([-_\s,a-zA-Z0-9+]*)/page/([0-9]*) index.php?tag=$1&page=$2 [L]

# web_base/tag/tag1+tag2
RewriteRule tag/([-_\s,a-zA-Z0-9+]*) index.php?tag=$1 [L]

# web_base/pic/17
RewriteRule pic/([0-9]*) index.php?pic=$1 [L]

# web_base/page/4
RewriteRule page/([0-9]*) index.php?page=$1 [L]


</IfModule>