-
Notifications
You must be signed in to change notification settings - Fork 2
/
htaccess.txt
156 lines (125 loc) · 7.88 KB
/
htaccess.txt
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# htaccess file version 1.4.4;
# When Zenphoto requires changes to the rewrite rules:
# First make a copy of this file as 'oldhtaccess' in the zp-core folder so setup can test for unmodified files
# Update the above and the define in setup.php
<IfModule mod_autoindex.c>
IndexIgnore *
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# Redirection for site updates--remove the comment crosshatches from the following rules
# "closed.html" in the plugins/site_upgrade folder is the target for the rewrites. You can change
# this file to suit your needs.
# RewriteRule ^index\.php$ plugins/site_upgrade/closed.php [NC,R=302,L]
# RewriteRule ^$ plugins/site_upgrade/closed.php [NC,R=302,L]
# End redirection for site updates
RewriteRule ^admin/?$ zp-core/admin.php [R,L]
#Rewrite rules for replaced ?RSS-xxx query parameters
RewriteCond %{QUERY_STRING} ^rss-(.*)&
RewriteRule ^index\.php?$ index.php?rss=%1 [NC,L,QSA,R=301]
RewriteCond %{QUERY_STRING} ^rss-(.*)$
RewriteRule ^index\.php?$ index.php?rss=%1 [NC,L,QSA,R=301]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^albums/?(.+/?)?$ $1 [R=301,L]
#New rewrite rule need as /trac is not a real directory which conflicts otherwise with ZPs own rewrite rules
RewriteCond %{REQUEST_URI} /trac
# RewriteCond %{REQUEST_URI} /trac[/]{0,1}/$
RewriteRule ^.*$ - [L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [L]
##### put no rules before this line #######
###########################################
#Rewrite rules for outdated Wordpress links
###########################################
RewriteRule ^category/News/feed/ index.php?rss-news&withimages [L,R=301]
#direct ones for hte WP pages we use - could not figure out a general one somehow
RewriteRule ^about-us pages/about-us [L,R=301]
RewriteRule ^contact pages/contact [L,R=301]
RewriteRule ^licenses pages/licenses [L,R=301]
RewriteRule ^privacy pages/privacy [L,R=301]
RewriteRule ^get-involved pages/get-involved [L,R=301]
RewriteRule ^category/(.*)/page/([0-9]+)?/$ news/category/$1/$2 [L,R=301]
RewriteRule ^category/(.*)?/$ news/category/$1 [L,R=301]
RewriteRule ^([0-9]+)/([0-9]+)/(.*)?/$ news/$3 [L,R=301]
#rewrite rule for zp subfolder
RewriteRule ^zp/(.*)/?$ $1 [L,R=301]
RewriteRule ^news/troubleshooting-zenphoto/?$ news/troubleshooting-guide$1 [L,R=301]
RewriteRule ^news/troubleshooting-zenpage/?$ news/troubleshooting-guide$1 [L,R=301]
#######################
#Rewrite rules for removed sitemap.php
RewriteRule ^sitemap\.php index.php?sitemap [L,R=301]
#Rewrite rules for removed RSS files
RewriteCond %{QUERY_STRING} albumtitle=(.*)&albumname=(.*)&lang=".$lang
RewriteRule ^rss\.php/?$ index.php?rss&albumtitle=%1&albumname=%2&lang=%3 [L,R=301]
RewriteCond %{QUERY_STRING} albumtitle=(.*)&folder=(.*)&lang=(.*)
RewriteRule ^rss\.php/?$ index.php?rss&albumtitle=%1&folder=%2&lang=%3 [L,R=301]
RewriteCond %{QUERY_STRING} albumtitle=(.*)&albumname=(.*)&lang=(.*)
RewriteRule ^rss\.php/?$ index.php?rss&albumtitle=%1&albumname=%2&lang=%3 [L,R=301]
RewriteCond %{QUERY_STRING} folder=(.*)&lang=(.*)&albumsmode
RewriteRule ^rss\.php/?$ index.php?rss&folder%1&lang=%2&albumsmode [L,R=301]
RewriteCond %{QUERY_STRING} withimages&lang=(.*)
RewriteRule ^rss-news\.php/?$ index.php?rss-news&withimages&lang=%1 [L,R=301]
RewriteCond %{QUERY_STRING} id=(.*)&title=(.*)&type=(.*)&lang=(.*)
RewriteRule ^rss-comments\.php/?$ index.php?rss-comments&id=%1&title=%2&type=%3&lang=%4 [L,R=301]
RewriteCond %{QUERY_STRING} type=(.*)&lang=(.*)
RewriteRule ^rss-comments\.php/?$ index.php?rss-comments&type=%1&lang=%2 [L,R=301]
RewriteCond %{QUERY_STRING} lang=(.*)&albumsmode
RewriteRule ^rss\.php/?$ index.php?rss&lang=%1&albumsmode [L,R=301]
RewriteCond %{QUERY_STRING} lang=(.*)&category=(.*)
RewriteRule ^rss-news\.php/?$ index.php?rss-news&lang=%1&category=%2 [L,R=301]
RewriteCond %{QUERY_STRING} lang=(.*)
RewriteRule ^rss\.php/?$ index.php?rss&lang=%1 [L,R=301]
RewriteRule ^rss-news\.php/?$ index.php?rss-news&lang=%1 [L,R=301]
#Rewrite rules for replaced RSS query parameters
RewriteCond %{QUERY_STRING} withimages&lang=(.*)
RewriteRule ^index\.php?rss-news/?$ index.php?rss=news&withimages&lang=%1 [L,R=301]
RewriteCond %{QUERY_STRING} id=(.*)&title=(.*)&type=(.*)&lang=(.*)
RewriteRule ^index\.php?rss-comments/?$ index.php?rss=comments&id=%1&title=%2&type=%3&lang=%4 [L,R=301]
RewriteCond %{QUERY_STRING} type=(.*)&lang=(.*)
RewriteRule ^index\.php?rss-comments/?$ index.php?rss=comments&type=%1&lang=%2 [L,R=301]
RewriteCond %{QUERY_STRING} lang=(.*)&category=(.*)
RewriteRule ^index\.php?rss-news/?$ index.php?rss=news&lang=%1&category=%2 [L,R=301]
RewriteCond %{QUERY_STRING} lang=(.*)
RewriteRule ^index\.php?rss-news/?$ index.php?rss=news&lang=%1 [L,R=301]
#rewrite rule for tinyURLs
RewriteRule ^tiny/([0-9]+)/?$ index.php?p=$1&t [L,QSA]
RewriteRule index\.php$ index.php [L,QSA]
RewriteRule ^page/([0-9]+)/?$ index.php?page=$1 [L,QSA]
RewriteRule ^page/([A-Za-z0-9_\-]+)/?$ index.php?p=$1 [L,QSA]
RewriteRule ^page/([A-Za-z0-9_\-]+)/([0-9]+)/?$ index.php?p=$1&page=$2 [L,QSA]
RewriteRule ^(.*)/page/([0-9]+)/?$ index.php?album=$1&page=$2 [L,QSA]
RewriteRule ^(.*)/page/([A-Za-z0-9_\-]+)/?$ index.php?album=$1&p=$2 [L,QSA]
#### Rewrite rule addition for search
RewriteRule ^page/search/fields([0-9]+)/(.*)/([0-9]+)/?$ index.php?p=search&searchfields=$1&words=$2&page=$3 [L,QSA]
RewriteRule ^page/search/fields([0-9]+)/(.*)/?$ index.php?p=search&searchfields=$1&words=$2 [L,QSA]
RewriteRule ^page/search/archive/(.*)/([0-9]+)/?$ index.php?p=search&date=$1&page=$2 [L,QSA]
RewriteRule ^page/search/archive/(.*)/?$ index.php?p=search&date=$1 [L,QSA]
RewriteRule ^page/search/tags/(.*)/([0-9]+)/?$ index.php?p=search&searchfields=tags&words=$1&page=$2 [L,QSA]
RewriteRule ^page/search/tags/(.*)/?$ index.php?p=search&searchfields=tags&words=$1 [L,QSA]
RewriteRule ^page/search/(.*)/([0-9]+)/?$ index.php?p=search&words=$1&page=$2 [L,QSA]
RewriteRule ^page/search/(.*)/?$ index.php?p=search&words=$1 [L,QSA]
#### Rewrite additions for zenpage
RewriteRule ^pages/?$ index.php?p=pages [L,QSA]
RewriteRule ^pages/(.*)/?$ index.php?p=pages&title=$1 [L,QSA]
RewriteRule ^news/?$ index.php?p=news [L,QSA]
RewriteRule ^news/([0-9]+)/?$ index.php?p=news&page=$1 [L,QSA]
RewriteRule ^news/category/(.*)/([0-9]+)/?$ index.php?p=news&category=$1&page=$2 [L,QSA]
RewriteRule ^news/category/(.*)/?$ index.php?p=news&category=$1 [L,QSA]
RewriteRule ^news/archive/(.*)/([0-9]+)/?$ index.php?p=news&date=$1&page=$2 [L,QSA]
RewriteRule ^news/archive/(.*)/?$ index.php?p=news&date=$1 [L,QSA]
RewriteRule ^news/(.*)/?$ index.php?p=news&title=$1 [L,QSA]
####
RewriteRule ^(.*)/image/(thumb|[0-9]{1,4})/([^/\\]+)$ zp-core/i.php?a=$1&i=$3&s=$2 [L,QSA]
RewriteRule ^(.*)/image/([^/\\]+)$ zp-core/i.php?a=$1&i=$2 [L,QSA]
RewriteRule ^(.*)/album/(thumb|[0-9]{1,4})/([^/\\]+)$ zp-core/i.php?a=$1&i=$3&s=$2&album=true [L,QSA]
####
# Catch-all - everything else gets handled in PHP for compatibility.
RewriteRule ^(.*)/?$ index.php?album=$1 [L,QSA]
</IfModule>
php_flag log_errors on
# The following will disclose full site paths. Probably better to set it off.
# Probably have to look at the log to find the errors anyway
#php_flag display_errors on
php_value error_log /var/tmp/php_errors2.log