PHPackages                             tourze/symfony-fake-404-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. tourze/symfony-fake-404-bundle

ActiveSymfony-bundle[Templating &amp; Views](/categories/templating)

tourze/symfony-fake-404-bundle
==============================

404 错误页面

1.0.2(4mo ago)025MITPHPCI passing

Since Mar 30Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/tourze/symfony-fake-404-bundle)[ Packagist](https://packagist.org/packages/tourze/symfony-fake-404-bundle)[ RSS](/packages/tourze-symfony-fake-404-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (21)Versions (8)Used By (0)

Symfony Fake 404 Bundle
=======================

[](#symfony-fake-404-bundle)

[English](README.md) | [中文](README.zh-CN.md)

[![Latest Version](https://camo.githubusercontent.com/47dee955c00eb385b75a3eefcc72954c1fe419194dc4188654ee6ef8e85d4c59/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f746f75727a652f73796d666f6e792d66616b652d3430342d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tourze/symfony-fake-404-bundle)[![Total Downloads](https://camo.githubusercontent.com/2e0a16740941b7569e0e0521d12ec168c8e8a7a3e546e0e28d4fba01cfe0da70/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f746f75727a652f73796d666f6e792d66616b652d3430342d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tourze/symfony-fake-404-bundle)[![License](https://camo.githubusercontent.com/5bba8c0a25f6a2fdd669c138ecfd980b30212c2bd82a3f42a435b95a090f33e2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f746f75727a652f73796d666f6e792d66616b652d3430342d62756e646c652e7376673f7374796c653d666c61742d737175617265)](LICENSE)

A Symfony bundle that displays random custom 404 error pages instead of the default Symfony error page. This bundle helps obfuscate your application's technology stack by displaying error pages that mimic other web servers like Nginx, IIS, Apache Tomcat, and CodeIgniter.

Features
--------

[](#features)

- **Automatic 404 Error Handling**: Seamlessly captures all 404 (Not Found) errors
- **Random Error Page Display**: Randomly selects and displays one of the available custom 404 pages
- **Pre-designed Templates**: Includes multiple error page templates mimicking popular web servers:
    - Nginx style 404 page
    - IIS style 404 page
    - IIS6 style 404 page
    - Apache Tomcat style 404 page
    - CodeIgniter style 404 page
- **Easy Customization**: Simple to add new custom error pages
- **Twig Template Support**: Fully customizable through Twig templates
- **Zero Configuration**: Works out of the box with no additional configuration required
- **Security Enhancement**: Helps obfuscate your application's underlying technology stack

Installation
------------

[](#installation)

### Requirements

[](#requirements)

- PHP 8.1 or higher
- Symfony 6.4 or higher
- Symfony Twig Bundle

### Via Composer

[](#via-composer)

```
composer require tourze/symfony-fake-404-bundle
```

### Bundle Registration

[](#bundle-registration)

Enable the bundle in `config/bundles.php`:

```
return [
    // ...
    Tourze\Fake404Bundle\Fake404Bundle::class => ['all' => true],
];
```

Quick Start
-----------

[](#quick-start)

Once installed, the bundle automatically captures all 404 errors and displays a random error page template. No additional configuration is required.

### Basic Usage

[](#basic-usage)

```
