如何在apache 2上创建别名文件夹

时间:2013-06-27 19:47:28

标签: php apache2 virtual mod-alias

我想在Apache2中创建一个文件夹的别名(使用centos 6和PHP5.4)。我的想法是将项目从一台服务器迁移到另一台服务器。

示例:

htaccess的:

SetAlias /home/before.com/ /home/after.com/

PHP

include( '/home/before.com/header.php' );//include header from "/home/after.com/"

谢谢!

1 个答案:

答案 0 :(得分:1)

这是错误的做法。请参阅文档:http://httpd.apache.org/docs/current/mod/mod_alias.html

您也无法在.htaccess中设置别名。