Why DokuWiki URLs Look Broken by Default
A fresh DokuWiki install serves every page through a query string that looks like https://wiki.example.com/doku.php?id=namespace:page. This works, but it reads poorly, exposes the PHP entry script, and gives search crawlers a weaker signal about page hierarchy than a clean path such as /namespace/page. DokuWiki supports three URL modes, controlled by the userewrite configuration value: mode 0 (the default query string), mode 1 (.htaccess-based rewriting producing /doku.php/namespace:page style paths), and mode 2 (PHP-internal rewriting, which does not require any rewrite engine but still keeps doku.php in the URL). On LiteSpeed Web Server, which is what powers your Hostiso account and reads Apache-style .htaccess files natively, mode 1 is the one worth configuring because it removes the script name and gives you URLs that are both human-friendly and crawler-friendly.
The reason mode 1 is not enabled out of the box is that it depends on two things being correct at once: the rewrite rules must be present in the .htaccess file at your document root, and the DOCUMENT_ROOT needs to be interpreted in a way that matches the basedir DokuWiki computes. When people enable nice URLs and immediately get a wall of 404s or an infinite redirect loop, the cause is almost always a mismatch between those two pieces, or a leftover RewriteBase that does not reflect the actual subdirectory the wiki lives in. Because you are operating as an unprivileged hosting user, every fix here happens through the DirectAdmin File Manager, the DokuWiki Configuration Manager, and the account-level .htaccess file. No server configuration, no SSH root, and nothing under /etc/ is involved.
Enabling Rewrite Mode and the Correct .htaccess
Start by locating your DokuWiki document root in DirectAdmin. For a primary domain the path is typically /domains/example.com/public_html, and for a subdomain like wiki.example.com it is usually /domains/example.com/public_html/wiki. Open DirectAdmin → File Manager and navigate there. DokuWiki ships a template rewrite file named .htaccess.dist in that same folder. Copy it to .htaccess (use the File Manager copy/rename action rather than creating from scratch so you keep the maintained ruleset), then open it for editing.
The working ruleset for LiteSpeed on a domain root looks like this:
# DokuWiki friendly URLs
RewriteEngine On
RewriteBase /
# protect sensitive data and internal directories
RewriteRule ^_media/(.*) lib/exe/fetch.php?media=$1 [QSA,L]
RewriteRule ^_detail/(.*) lib/exe/detail.php?media=$1 [QSA,L]
RewriteRule ^_export/([^/]+)/(.*) doku.php?do=export_$1&id=$2 [QSA,L]
# main rewrite to doku.php
RewriteRule ^$ doku.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) doku.php?id=$1 [QSA,L]
RewriteRule ^index.php$ doku.php [L]
If your wiki lives in a subdirectory such as /wiki/, change the base line to RewriteBase /wiki/ and leave the rest intact. The two RewriteCond lines that test for an existing file or directory are what stop the rewrite from swallowing real assets like CSS and images, so never remove them. Save the file.
Now tell DokuWiki to produce the matching links. In the wiki go to Admin → Configuration Settings (the /doku.php?do=admin&page=config page). Under the Advanced section set userewrite to 1 (.htaccess), and tick useslash if you want colons in namespaces rendered as forward slashes, which is the more conventional look for SEO. Save. Visit any page and confirm the address bar now shows a clean path. If you instead see a 404, the most common reasons are a wrong RewriteBase, or that you edited .htaccess.dist instead of .htaccess. If you prefer to avoid .htaccess entirely, set userewrite to 2 instead; that mode needs no rewrite rules and is a reliable fallback when a host blocks mod_rewrite behaviour, though it keeps doku.php in the path.
Canonical HTTPS, WWW Normalization, and Redirect Loops
Friendly URLs only help SEO if every page resolves to a single canonical address. Duplicate content across http/https and www/non-www splits crawl signals and can cause ranking dilution. Set the canonical base inside DokuWiki first: on the Configuration Settings page, set baseurl to your preferred scheme and host, for example https://wiki.example.com, and leave basedir empty unless the wiki is in a subfolder. This makes DokuWiki emit absolute canonical links and correct Open Graph URLs.
Then enforce the redirect at the edge. Add these rules at the top of the same .htaccess, immediately after RewriteEngine On and before the DokuWiki rules, so the canonical redirect happens before any internal rewrite:
# Force HTTPS
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://wiki.example.com/$1 [R=301,L]
# Force non-www to a single host (adjust to taste)
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
A frequent trap on shared hosting is a redirect loop after adding the HTTPS rule. This happens when a proxy or LiteSpeed terminates TLS and the %{HTTPS} variable does not read as on behind it. If you hit that loop, swap the first condition to inspect the forwarded header instead: RewriteCond %{HTTP:X-Forwarded-Proto} !https. Keep only one of the two HTTPS tests active. Because 301 responses are cached aggressively by browsers, always test canonical changes in a private window, and clear the LiteSpeed cache for the domain through the DirectAdmin LiteSpeed Web Cache Manager if stale redirects persist. For a handful of renamed or moved pages, add targeted entries rather than guessing with patterns, for example Redirect 301 /old-page https://wiki.example.com/new-page.
Sitemaps, 404 Handling, and Clean Indexing
DokuWiki generates an XML sitemap automatically. On the Configuration Settings page set sitemap to a non-zero number of days, for example 1, which tells the wiki to rebuild the sitemap and ping search engines on that interval whenever a visitor triggers it. The file is written to data/cache/sitemap.xml.gz and served through https://wiki.example.com/doku.php?do=sitemap. Submit that URL in Google Search Console. If the sitemap never appears, confirm the data/cache directory is writable in File Manager (DirectAdmin shows permissions in the right-hand column; 755 on directories owned by your account is correct) and that data/ sits outside the web root or is protected, which the shipped .htaccess handles.
Control what crawlers index with the indexdelay and robots handling built in, and place a robots.txt at the document root that excludes action URLs to prevent crawl waste on edit, diff, and export links:
User-agent: *
Disallow: /lib/
Disallow: /data/
Disallow: /doku.php?do=
Disallow: /_export/
Sitemap: https://wiki.example.com/doku.php?do=sitemap
For 404s, DokuWiki returns its own "page does not exist" template with a proper HTTP 404 status, which is the correct behaviour for crawlers; do not mask it with an ErrorDocument 200 page. If you see 404s on pages that clearly exist after enabling rewrites, the cause is namespace casing or colon-to-slash translation, so verify useslash matches the links in your content. When legitimate pages have moved, record them in .htaccess as 301s as shown earlier. Keep an eye on your account's error_log (visible in File Manager at the domain root or under DirectAdmin → Logs) after any rewrite change; Request exceeded the limit of 10 internal redirects entries are the signature of a loop, and File does not exist entries point to a missing asset path rather than a DokuWiki fault. If you also run other wikis and want deeper database-side tuning for large installs, the approach in our MediaWiki database maintenance guide covers related cleanup techniques that translate well to any PHP wiki stack.