genj/short-url-bundle
最新稳定版本:v1.0.4
Composer 安装命令:
composer require genj/short-url-bundle
包简介
Symfony Short Url bundle
README 文档
README
Provides a way to redirect requests based on an Entity stored in the database. Features:
- redirect client based on the request path, e.g. '/something'
- internal and external redirects to a path or url
- with start/end datetime
- configurable http status code
- keeps the query string parameters when redirecting
Installation
Add this to your composer.json:
...
"require": {
...
"genj/short-url-bundle": "dev-master"
...
Then run composer update. After that is done, enable the bundle in your AppKernel.php:
# app/AppKernel.php
class AppKernel extends Kernel
{
public function registerBundles() {
$bundles = array(
...
new Genj\ShortUrlBundle\GenjShortUrlBundle()
...
Finally, update your database schema:
php app/console doctrine:schema:update
And you're done.
Usage
Add a new record to your database. Example:
- source: /my-old-url
- target: /my-new-url
- httpStatusCode: 301
- publishAt: (now)
FAQ
My redirect is not working through app.php, but it works through app_dev.php
If you have enabled caching, it can happen that a 404 response is stored in the http cache, so clear your caches. The redirect requests themselves have private caching headers.
统计信息
- 总下载量: 3.24k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-01-26