Question: Zend framework 2x how can i make `http://www.example.com/robots.txt` ?
i have following in bootstrap but it fails to understand the "robots.txt" only works when i go to `http://www.example.com/robots`

```
$route = Http\Segment::factory(array(
  'route' => '/robots[/:action]',
  'defaults' => array(
    'controller' => 'Application\Controller\Sitemap',
    'action' => 'index'
  ),
));
$router->addRoute('robots', $route, null);

```

Answer: 
You can use the H flag of apach mode rewrite to force all files without an extension to be parsed by The php handler :

try the following in htaccess :

```
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule !\. - [H=application/x-httpd-php]

```

on some servers, you have to change httpd-php by httpd-php5 :

```
RewriteRule !\. - [H=application/x-httpd-php5]

```
According to Apache, you should not be using .htaccess: <https://httpd.apache.org/docs/current/howto/htaccess.html#when>

For the answer to your question, read my post here: <https://stackoverflow.com/a/59868481/10664600>

```
sudo vim /etc/httpd/conf/httpd.conf

```