URL Rewrite
The generated web application requires URL Rewrite, you need to configure your web server to send HTTP requests to your PHP front-controller file, i.e. the index.php.
By default .htaccess files (for Apache) and web.config file (for IIS) will be generated for your web server. There should be no need to configure manually. However, if the generated files do not work for your web server, you should check the follows.
Apache
Ensure that the Apache mod_rewrite module is installed and enabled. Ensure your .htaccess and index.php files are in the same directory. The *.htaccess* file should contain at least the following rules:
**Notes**
1. From v2024, there should be no need to set `RewriteBase` directives. The generated _.htaccess_ stores the current location in an environment variable to rewrite without `RewriteBase`.
1. The authorization header `X-Authorization` above is just an example, the actual value is generated according to the advanced setting [JWT authorization header](tools.html?id=jwt-authorization-header).
Make sure your virtual host is configured with the [AllowOverride](https://httpd.apache.org/docs/current/mod/core.html#allowoverride) directive so that the *.htaccess* rewrite rules can be used. Open your *httpd.conf* or *apache.conf* in a text editor, and locate the ```` section and change the ``AllowOverride`` line to ``ALL``.
If the Apache module mod_authz_core is enabled, make sure you configure the Require directive properly, e.g. Require all granted grants access to all requests.
Nginx
This is an example Nginx virtual host configuration for the domain example.com. It listens for inbound HTTP connections on port 80.
**Note** The following assumes a PHP-FPM server is running on port 9123. You must update the server_name, error_log, access_log,
and root directives with your own values. The ``root`` directive is the path to your application's public document root directory,
the index.php front-controller file should be in this directory.
Internet Information Services (IIS)
The **URL Rewrite module** is not built-in, so you need to download and install the IIS URL Rewrite module from the [microsoft web site](https://www.iis.net/downloads/microsoft/url-rewrite). After installing, you should see **URL Rewrite module** in IIS Manager for your web site:

PHPMaker will generate a sample _web.config_. Ensure the _web.config_ and _index.php_ files are in the same directory (the project folder). The _web.config_ file should contain:
If you customize the _web.config_, you can disable the advanced setting [Generate web.config](tools.html?id=generate-web-config) so it will not be overwritten by next generation.
To understand more about the IIS URL Rewrite, see [Using the URL Rewrite Module](https://docs.microsoft.com/en-us/iis/extensions/url-rewrite-module/using-the-url-rewrite-module).
Also See
Configuring a Web Server
Apache Module mod_rewrite
Using the URL Rewrite Module (for IIS)