Skip to content
Sebastian Schendel edited this page Nov 1, 2025 · 6 revisions

Frequently Asked Questions

How can I place my ProcessWire in a subdirectory?

Since v1.4.0 it is possible to place your ProcessWire instance in a subdirectory (like „/backend“) and use it as a headless CMS for e.g. a Javascript-application which is placed in the root.

AppApi has a configuration option to remove the ProcessWire root (subdirectory path) from all links, which could be handy for the mentioned Javascript-application placed in the root directory. The application can organize routing by itself and pass the current route to the ProcessWire backend, which returns the page’s data.

When the option is activated, all page links generated by AppApi::getAjaxOf() will be returned without the ProcessWire root. For your custom output you can use the helper functions AppApi::getUrlRelativeToRoot($url), AppApi:: getHttpUrlRelativeToRoot($httpUrl) and AppApi:: replaceRootLinksInText($text) to replace your link urls.

My Authorization Token is not recognized by AppApi.

In some cases the server config does block Authentication Headers by default. Try adding the following line to your .htaccess file:

RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

In other cases it helped to add the following line:

SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1

I really want to avoid having to set a header for the apikey.

If you want to include an image from the api using the standard <img src=""> tag, it can be very difficult to include the api key and a token as headers. However, it is possible to include these values as GET parameters. The GET parameter with the apikey is called api_key. A token can be sent as parameter authorization.

Disclaimer: I recommend to use this solution only for this exceptional case. Generally headers are the better and more elegant solution.

I do not see my api contents, only HTML of my home page

Please check if ProcessWires urlSegments feature is enabled for your homepage. It must be turned off so that the api url can correctly be sent to the AppApi module.


➡️ Continue with Changelog

⬅️ Back to 1: Home, Installation & Quickstart

Clone this wiki locally