如何在Apache2或mod_rewrite上重定向ServerAlias?

时间:2015-04-22 09:04:43

标签: php apache .htaccess mod-rewrite redirect

我在Apache中有一个虚拟主机

<VirtualHost *:8080>
   ServerName example.eu
   ServerAlias www.example.eu
   ServerAlias www.somethingElseThanExample.net
   DocumentRoot "/something"
   <Directory "something">
       Options ExecCGI FollowSymLinks
        AllowOverride all
        Allow from all
        Order allow,deny
    </Directory>
</VirtualHost>

我想重定向

www.somethingElseThanExample.netwww.somethingElseThanExample.net/foo/

这必须适用于主页和内部页面,以便

www.somethingElseThanExample.net/bar/www.somethingElseThanExample.net/foo/bar/

可以通过我的htaccess使用Apache mod_rewrite吗?我如何在每种情况下这样做?

如果我只需要将此结果用于主页,该怎么办?

1 个答案:

答案 0 :(得分:1)

由于您似乎可以访问VirtualHost,因此您可以将以下内容添加到$dateMaturity->add($config->getDelayInterval()); 部分:

<Directory>
相关问题