| author | Tomas Zeman <tomas@functionals.cz> |
| Fri, 31 Dec 2021 12:25:17 +0100 | |
| changeset 41 | c4f9f37e9a28 |
| parent 11 | da454bf1bf63 |
| permissions | -rw-r--r-- |
|
10
53c01c16b1cb
lighttpd/gpeasy: configuring gpEasy w/ lighttpd
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
1 |
Rewrite rules for gpeasy: |
|
53c01c16b1cb
lighttpd/gpeasy: configuring gpEasy w/ lighttpd
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
2 |
|
|
53c01c16b1cb
lighttpd/gpeasy: configuring gpEasy w/ lighttpd
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
3 |
url.rewrite-if-not-file = ( |
|
11
da454bf1bf63
lighttpd/gpeasy: proper rewrite for query params
Tomas Zeman <tzeman@volny.cz>
parents:
10
diff
changeset
|
4 |
"^/([^.?]*)\?(.*)$" => "/index.php?$1&$2", |
|
da454bf1bf63
lighttpd/gpeasy: proper rewrite for query params
Tomas Zeman <tzeman@volny.cz>
parents:
10
diff
changeset
|
5 |
"^/([^.?]*)$" => "/index.php?$1", |
|
10
53c01c16b1cb
lighttpd/gpeasy: configuring gpEasy w/ lighttpd
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
6 |
) |
|
53c01c16b1cb
lighttpd/gpeasy: configuring gpEasy w/ lighttpd
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
7 |
|
|
53c01c16b1cb
lighttpd/gpeasy: configuring gpEasy w/ lighttpd
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
8 |
Based on following article: configuring w/ nginx: |
|
53c01c16b1cb
lighttpd/gpeasy: configuring gpEasy w/ lighttpd
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
9 |
|
|
53c01c16b1cb
lighttpd/gpeasy: configuring gpEasy w/ lighttpd
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
10 |
http://www.computercorrect.com/2011/web-applications/configuring-nginx-for-gpeasy-cms/ |
|
53c01c16b1cb
lighttpd/gpeasy: configuring gpEasy w/ lighttpd
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
11 |
|
|
53c01c16b1cb
lighttpd/gpeasy: configuring gpEasy w/ lighttpd
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
12 |
First, you should edit the index.php file in gpEasy’s root directory. Uncomment |
|
53c01c16b1cb
lighttpd/gpeasy: configuring gpEasy w/ lighttpd
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
13 |
the line that mentions “gp_indexphp”, so that your file looks likes this: |
|
53c01c16b1cb
lighttpd/gpeasy: configuring gpEasy w/ lighttpd
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
14 |
|
|
53c01c16b1cb
lighttpd/gpeasy: configuring gpEasy w/ lighttpd
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
15 |
1 //define('gpdebug',true);
|
|
53c01c16b1cb
lighttpd/gpeasy: configuring gpEasy w/ lighttpd
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
16 |
2 define('gp_indexphp',false);
|
|
53c01c16b1cb
lighttpd/gpeasy: configuring gpEasy w/ lighttpd
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
17 |
3 //define('gptesting',true);
|
|
53c01c16b1cb
lighttpd/gpeasy: configuring gpEasy w/ lighttpd
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
18 |
4 require_once('./include/main.php');
|
|
53c01c16b1cb
lighttpd/gpeasy: configuring gpEasy w/ lighttpd
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
19 |
|
|
53c01c16b1cb
lighttpd/gpeasy: configuring gpEasy w/ lighttpd
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
20 |
This tells gpEasy to use permalinks without “index.php” appearing in the URL. |
|
53c01c16b1cb
lighttpd/gpeasy: configuring gpEasy w/ lighttpd
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
21 |
|
|
53c01c16b1cb
lighttpd/gpeasy: configuring gpEasy w/ lighttpd
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
22 |
Next, you need to edit the appropriate nginx site configuration file so that is |
|
53c01c16b1cb
lighttpd/gpeasy: configuring gpEasy w/ lighttpd
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
23 |
has a conditional rewrite rule like the one below: |
|
53c01c16b1cb
lighttpd/gpeasy: configuring gpEasy w/ lighttpd
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
24 |
|
|
53c01c16b1cb
lighttpd/gpeasy: configuring gpEasy w/ lighttpd
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
25 |
1 location /gpeasy/ {
|
|
53c01c16b1cb
lighttpd/gpeasy: configuring gpEasy w/ lighttpd
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
26 |
2 |
|
53c01c16b1cb
lighttpd/gpeasy: configuring gpEasy w/ lighttpd
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
27 |
3 index index.php index.htm index.html; |
|
53c01c16b1cb
lighttpd/gpeasy: configuring gpEasy w/ lighttpd
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
28 |
4 |
|
53c01c16b1cb
lighttpd/gpeasy: configuring gpEasy w/ lighttpd
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
29 |
5 if (!-e $request_filename){
|
|
53c01c16b1cb
lighttpd/gpeasy: configuring gpEasy w/ lighttpd
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
30 |
6 rewrite ^(.+)$ /gpeasy/index.php?$1 last; |
|
53c01c16b1cb
lighttpd/gpeasy: configuring gpEasy w/ lighttpd
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
31 |
7 } |
|
53c01c16b1cb
lighttpd/gpeasy: configuring gpEasy w/ lighttpd
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
32 |
8 |
|
53c01c16b1cb
lighttpd/gpeasy: configuring gpEasy w/ lighttpd
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
33 |
9 } |
|
53c01c16b1cb
lighttpd/gpeasy: configuring gpEasy w/ lighttpd
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
34 |
|
|
53c01c16b1cb
lighttpd/gpeasy: configuring gpEasy w/ lighttpd
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
35 |
(Note that if your gpEasy installation is in your site’s root directory, then |
|
53c01c16b1cb
lighttpd/gpeasy: configuring gpEasy w/ lighttpd
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
36 |
you’ll replace “/gpeasy/” with “/” throughout the block above.) |
|
53c01c16b1cb
lighttpd/gpeasy: configuring gpEasy w/ lighttpd
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
37 |
|
|
53c01c16b1cb
lighttpd/gpeasy: configuring gpEasy w/ lighttpd
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
38 |
Lastly, restart nginx and proceed with the installation of gpEasy. |