我有一些域名都指向同一台服务器,我正在寻找一种方法来访问每个域名作为一种共享资源在一个位置的一组脚本。别名,mod_rewrite或其他共享的PHP脚本?
例如
http://abcdeals.com/shared-resource/
http://defdeals.com/shared-resource/
http://hijdeals.com/shared-resource/
都使用相同的文件在/家庭/ zdeals /的public_html /共享资源/
全部细节:
的 “共享资源” 的文件驻留在以下服务器路径
/home/zdeals/public_html/shared-resource/
例如,多个域名(abcdeals.com,defdeals.com和hijdeals.com)驻留在以下服务器路径
/home/abcdeals/public_html/
/home/defdeals/public_html/
/home/hijdeals/public_html/
我非常希望能够通过访问
http://abcdeals.com/shared-resource/
http://defdeals.com/shared-resource/
http://hijdeals.com/shared-resource/
访问共享的资源文件,而无需将用户重定向
我一直在寻找别名和mod_rewrite,但无济于事。 有些事情我已经在/home/abcdeals/public_html/.htaccess试图
AliasMatch ^/shared-resource(.*) /home/zdeals/public_html/shared-resource$1
或
RewriteRule ^shared-resource/(.*) home/zdeals/public_html/shared-resource/$1 [L]
...还有更多类似的
我要么得到一个500内部服务器错误或404访问时未发现错误http://abcdeals.com/shared-resource/
如果有帮助,我也可以访问httpd.conf文件。
现有的.htaccess文件如下:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
#RewriteBase/
RewriteRule . index.php [PT]
RewriteRule ^(system/(classes|locale|schema|$)) index.php [PT]
我将有这方面的帮助,感激不尽。
我从来没有这样做,所以我不知道这是否是正确的方向......但你有没有尝试过使用符号链接(软链接)? – YonoRan 2012-03-23 21:16:13
有趣的想法,我会看看它 – 2012-03-23 21:19:26
你应该补充说,作为一个答案,它的工作完美。谢谢:) – 2012-03-23 21:48:43