PHPackages                             ilopx/yii2-basic-htaccess - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. ilopx/yii2-basic-htaccess

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ilopx/yii2-basic-htaccess
=========================

Set web directory in webroot

1.0(10y ago)6832530MITPHP

Since Aug 22Pushed 10y ago8 watchersCompare

[ Source](https://github.com/ilopX/yii2-basic-htaccess)[ Packagist](https://packagist.org/packages/ilopx/yii2-basic-htaccess)[ RSS](/packages/ilopx-yii2-basic-htaccess/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

\#Yii2 basic htaccess

[![Demo](https://github.com/ilopX/yii2-basic-htaccess/raw/master/example.png)](https://github.com/ilopX/yii2-basic-htaccess/blob/master/example.png)

Video Demo
----------

[](#video-demo)

[![Video Demo](https://camo.githubusercontent.com/7236711ace5a78d46af229c70f66a2eabab913053a06f06b060e5090a6ea67c1/687474703a2f2f696d672e796f75747562652e636f6d2f76692f307378714e617a6e686c632f302e6a7067)](http://www.youtube.com/watch?v=0sxqNaznhlc)

a. Automatic setting [index.php](https://cdn.rawgit.com/ilopX/yii2-basic-htaccess/master/index.php)
---------------------------------------------------------------------------------------------------

[](#a-automatic-setting-indexphp)

This method created .htaccess files automatically and clear self.

- Download file [index.php](https://cdn.rawgit.com/ilopX/yii2-basic-htaccess/master/index.php) or composer require ilopx/yii2-basic-htaccess
- Put to root yii2 application
- Start http://{your\_yii2\_webapp}
- Follow [step 3 in Manual setting](#3-step)

b. Manual setting
-----------------

[](#b-manual-setting)

### 1. step

[](#1-step)

#### create file {root}/.htaccess:

[](#create-file-roothtaccess)

```

    Options +FollowSymlinks
    RewriteEngine On

    RewriteCond %{REQUEST_URI} ^/.*
    RewriteRule ^(.*)$ web/$1 [L]

    RewriteCond %{REQUEST_URI} !^/web/
    RewriteCond %{REQUEST_FILENAME} !-f [OR]
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^.*$ web/index.php

```

### 2. step

[](#2-step)

#### create file {root}/web/.htaccess:

[](#create-file-rootwebhtaccess)

```
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php

```

### 3. step

[](#3-step)

#### update file {root}/config/web.php:

[](#update-file-rootconfigwebphp)

```
'request' => [
    'baseUrl' => '',
],
'urlManager' => [
    'enablePrettyUrl' => true,
    'showScriptName' => false,
    'rules' => [
        '' => 'site/index',
        ''=>'site/',
    ],
],
```

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity63

Established project with proven stability

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3959d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/dbeb16e138e09576fd322a216185b57744e5217c8fb944cb5f90d1fc53eecf20?d=identicon)[ilopX](/maintainers/ilopX)

---

Tags

htaccessphpyiiyii2-basic

### Embed Badge

![Health badge](/badges/ilopx-yii2-basic-htaccess/health.svg)

```
[![Health](https://phpackages.com/badges/ilopx-yii2-basic-htaccess/health.svg)](https://phpackages.com/packages/ilopx-yii2-basic-htaccess)
```

###  Alternatives

[bjornjohansen/wp-pre-commit-hook

Pre-commit hook for WordPress projects

119.1k7](/packages/bjornjohansen-wp-pre-commit-hook)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
