# Pathname information and the AcceptPathInfo directive

> Allow or block extra path information after a file name in URLs using Apache's AcceptPathInfo directive.

Source: https://helpcenter.ruachost.com/developers/web-servers/pathname-information-and-the-acceptpathinfo-directive/

By default, Apache does not allow URLs to contain **trailing pathname information** after a file name. On **ruachost.com**, you can enable this behavior using the `AcceptPathInfo` directive in your `.htaccess` file or Apache configuration.

## What Is Pathname Information?

Pathname information refers to extra data appended to a URL after a file name.

Example:

```
http://www.example.com/page.html/pathinfo
```

- `page.html` → the requested file.
- `/pathinfo` → trailing pathname information.

By default, Apache returns a **404 Not Found** error when such URLs are requested.

## Why Enable Pathname Information?

Some third‑party applications (e.g., **Moodle course management system**) rely on pathname information in URLs. Without enabling it, these applications may not function correctly.

## Using the AcceptPathInfo Directive

### Enable Pathname Information

Add the following line to your `.htaccess` file:

```
AcceptPathInfo On
```

### Disable Pathname Information

To turn it off:

```
AcceptPathInfo Off
```

> **Important Notes:**
- Works only if the Apache server has `mod_core` enabled (Ruachost servers support this).
- Use `AcceptPathInfo On` only when required by your application.
- Improper use may expose sensitive paths or cause unexpected behavior.
- Always test after enabling to confirm your application works correctly.
