armetiz / redirect-bundle
Symfony Bundle 用于管理域名
1.1.1
2013-10-15 15:08 UTC
Requires
- php: >=5.3.2
- symfony/symfony: >=2.0.17,<3
This package is not auto-updated.
Last update: 2024-09-14 14:59:05 UTC
README
你有许多域名
用户需要从 http://www.john-doe.fr/example 重定向到 http://john-doe.fr/example
安装
安装是一个快速的三步过程
- 使用 composer 下载 WozbeRedirectBundle
- 启用 Bundle
- 配置应用配置文件 config.yml
步骤 1:使用 composer 下载 WozbeRedirectBundle
在 composer.json 中添加 WozbeRedirectBundle
{ "require": { "wozbe/redirect-bundle": "*" } }
现在运行命令让 composer 下载 bundle
$ php composer.phar update wozbe/redirect-bundle
Composer 将 bundle 安装到项目的 vendor/wozbe
目录。
步骤 2:启用 bundle
在 kernel 中启用 bundle
<?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new Wozbe\RedirectBundle\WozbeRedirectBundle(), ); }
步骤 3:配置应用的 config.yml
最后,将以下内容添加到 config.yml 中
# app/config/config.yml wozbe_redirect: domains: john-doe.fr: aliases: - www.john-doe.fr - www.johndoe.fr - johndoe.fr foo-bar.fr: aliases: - www.foo-bar.fr - www.foobar.fr - foobar.fr
======= 管理多个域名的简短 Bundle