PHPackages                             giftcards/mod-rewrite - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. giftcards/mod-rewrite

ActiveLibrary[HTTP &amp; Networking](/categories/http)

giftcards/mod-rewrite
=====================

A PHP implementation of mod rewrite

1.2.0(6y ago)35.5k31MITPHPPHP &gt;=7.1CI failing

Since Feb 26Pushed 6y ago7 watchersCompare

[ Source](https://github.com/giftcards/ModRewrite)[ Packagist](https://packagist.org/packages/giftcards/mod-rewrite)[ RSS](/packages/giftcards-mod-rewrite/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (5)Versions (8)Used By (1)

Mod Rewrite [![Build Status](https://camo.githubusercontent.com/aa71eb045380a0823c61adbea8217f4f9678dbdc17a0040967183a2101d40de6/68747470733a2f2f7472617669732d63692e6f72672f6769667463617264732f4d6f64526577726974652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/giftcards/ModRewrite)
=======================================================================================================================================================================================================================================================================================================

[](#mod-rewrite-)

Purpose
-------

[](#purpose)

The mod rewrite library is meant to be a php implementation of mod rewrite. it can read the same directives given to the apache rewrite engine module and use them to rewrite given urls the same way as apache would.

Support
-------

[](#support)

RewriteRule, RewriteCond, RewriteEngine are supported with the caveat that certain server variables are not implemented yet in the replacements system as well as a bunch of the more advanced rewriting flags for the RewriteRule directive arent implemented. Adding support for these features as well as the other directives is pretty straightforward through extension it just hasn't been done yet. At the moment only the server variables QUERY\_STRING, REQUEST\_URI, REQUEST\_FILENAME, HTTP\_HOST are supported. Feel free to PR support for more!

Usage
-----

[](#usage)

### Basic

[](#basic)

if you just want to use the stock rewriter with a file you just need to use the 2 builders to build the rewriter and the file compiler

```
