rewrite
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rewrite [2017-08-29 17:41] – [IIS (or Microsoft Azure Web App)] 81.133.88.36 | rewrite [2022-12-29 15:24] (current) – [Also see] Michaelsy | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== URL Rewriting ====== | ====== URL Rewriting ====== | ||
- | |||
- | FIXME This page is a mess and should be rewritten. | ||
By default, DokuWiki does no URL rewriting, resulting in URLs like this: | By default, DokuWiki does no URL rewriting, resulting in URLs like this: | ||
Line 16: | Line 14: | ||
- Go to Admin | - Go to Admin | ||
- | - Open Configuration | + | - Open Configuration |
- Change Nice URLs option to .htaccess (use find, it's far down) | - Change Nice URLs option to .htaccess (use find, it's far down) | ||
- Underneath it, check the option to "Use slash as namespace separator in URLs" | - Underneath it, check the option to "Use slash as namespace separator in URLs" | ||
Line 97: | Line 95: | ||
Dokuwiki rewrite rule affect //apachectl status// command and make it return dokuwiki 404 page instead of the server-status page. You can fix that by either putting this in dokuwiki rewrite rules | Dokuwiki rewrite rule affect //apachectl status// command and make it return dokuwiki 404 page instead of the server-status page. You can fix that by either putting this in dokuwiki rewrite rules | ||
- | | + | <code apache> |
+ | RewriteCond %{REQUEST_URI} !^/ | ||
+ | </ | ||
or creating an empty server-status file in dokuwiki root folder where doku.php is located. See forum post [[http:// | or creating an empty server-status file in dokuwiki root folder where doku.php is located. See forum post [[http:// | ||
Line 107: | Line 107: | ||
Enable url rewriting and insert appropriate set of rules: | Enable url rewriting and insert appropriate set of rules: | ||
- | < | + | < |
< | < | ||
< | < | ||
Line 170: | Line 170: | ||
See [[http:// | See [[http:// | ||
- | < | + | < |
server { | server { | ||
listen 80; | listen 80; | ||
Line 188: | Line 188: | ||
rewrite ^/ | rewrite ^/ | ||
rewrite ^/ | rewrite ^/ | ||
- | rewrite ^/(?!lib/)(.*) / | + | rewrite ^/(.*) / |
} | } | ||
Line 206: | Line 206: | ||
in the server section with: | in the server section with: | ||
- | | + | <code nginx> |
+ | fastcgi_param HTTPS on; | ||
+ | </ | ||
The '' | The '' | ||
If you are copy-pasting these configs, make sure you are adding locations to secure some of the directories as described on [[security|Security]] page. | If you are copy-pasting these configs, make sure you are adding locations to secure some of the directories as described on [[security|Security]] page. | ||
+ | |||
+ | ==== httpd (OpenBSD) ==== | ||
+ | See also [[https:// | ||
+ | |||
+ | <code autoconf> | ||
+ | server " | ||
+ | listen on egress port 443 | ||
+ | root "/ | ||
+ | directory index doku.php | ||
+ | | ||
+ | # Set according to upload_max_filesize and post_max_size in php.ini | ||
+ | connection max request body 20971520 | ||
+ | |||
+ | location " | ||
+ | | ||
+ | # Block access to non-public dirs | ||
+ | location "/ | ||
+ | location "/ | ||
+ | location "/ | ||
+ | location "/ | ||
+ | location "/ | ||
+ | | ||
+ | # URL rewrite rules | ||
+ | location match "/ | ||
+ | request rewrite "/ | ||
+ | } | ||
+ | | ||
+ | location match "/ | ||
+ | request rewrite "/ | ||
+ | } | ||
+ | | ||
+ | location match "/ | ||
+ | request rewrite "/ | ||
+ | } | ||
+ | |||
+ | location match "/ | ||
+ | request rewrite "/ | ||
+ | } | ||
+ | |||
+ | location match "/ | ||
+ | request rewrite "/ | ||
+ | } | ||
+ | } | ||
+ | </ | ||
====== Option 2: DokuWiki ====== | ====== Option 2: DokuWiki ====== | ||
Line 216: | Line 262: | ||
In your conf/ | In your conf/ | ||
- | | $conf[' | + | <code php> |
+ | $conf[' | ||
+ | </ | ||
This option won't need any webserver setup. However it relies on the PATH_INFO feature of the CGI standard as implemented by Apache. IIS is [[bug> | This option won't need any webserver setup. However it relies on the PATH_INFO feature of the CGI standard as implemented by Apache. IIS is [[bug> | ||
Line 242: | Line 290: | ||
====== Also see ====== | ====== Also see ====== | ||
+ | |||
* [[: | * [[: | ||
+ | * [[https:// |
rewrite.1504021281.txt.gz · Last modified: 2017-08-29 17:41 by 81.133.88.36