不同的文件夹的子文件夹网站 [英] Different folder as website subfolder

查看:129
本文介绍了不同的文件夹的子文件夹网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一些帮助,URL重写。目前,此案与<类似href=\"http://stackoverflow.com/questions/3796586/zend-framework-and-word$p$pss-integration/3798811#3798811\">this 之一。

我有一个工作Zend框架的网站。现在,我必须添加一个博客在Word preSS(也正在)。我选择的的在ZF控制器 - /行动 - /路由决策放纵;我见过一对夫妇的这个教程,我认为他们太多的纯重定向。现在,有关重定向...

这是应该是这样的:


  • www.site.com (点 /无功/网络/ ZF

  • www.site.com/blog (点 /无功/网络/ WP

我知道我应该停止 www.site.com/blog 进入ZF的内脏,目前我在做这与重写规则^博客 - [NC,L] 在它的.htaccess,但仅​​此而已。作为<一个href=\"http://stackoverflow.com/questions/3796586/zend-framework-and-word$p$pss-integration/3798811#3798811\">@jason说,只是通过它传递到Word preSS,但我不知道究竟是如何做到这一点。

相关问题:结果
我从来没有尝试过,但Apache的支持这的两个不同的的虚拟主机?结果
服务器名称www.site.com (虚拟主机为ZF网站)结果
服务器名称www.site.com/blog (虚拟主机为WP网​​站)


解决方案

  

www.site.com(点到/ var / WWW / ZF)


  
  

www.site.com/blog(点到/ var / WWW / WP)


才达到这一点,你想要一个子URL到虚拟主机的DocumentRoot目录外点easiset方式是创建一个别名...

里面的虚拟主机块增加:

 别名/博客/无功/网络/ WP&LT;目录/ var / WWW /可湿性粉剂&GT;
    所有的选项
    所有的AllowOverride
    为了允许,拒绝
    所有允许
&LT; /目录&GT;

*假设你已经以某种方式为目录启用PHP。

I need some help with URL rewriting. The case is similar with this one.

I have a working Zend Framework site. Now I must add a blog in Wordpress (also working). I've chosen not to indulge in ZF controller-/action-/route-making; I've seen a couple of tutorials about this and I consider them too much for a "plain" redirection. Now, about that "redirection"...

This is how it should look like:

  • www.site.com (points to /var/www/zf)
  • www.site.com/blog (points to /var/www/wp)

I know that I should stop www.site.com/blog to enter ZF's innards and I'm currently doing this with RewriteRule ^blog - [NC,L] in its .htaccess, but that's about it. As @jason said, "just pass it through to Wordpress", but I don't know how exactly to do that.

Related question:
I never tried it, but does Apache support this in two different vhosts?
ServerName www.site.com (vhost for ZF site)
ServerName www.site.com/blog (vhost for WP site)

解决方案

www.site.com (points to /var/www/zf)

www.site.com/blog (points to /var/www/wp)

The easiset way to achive this, where you want a sub-url to point outside the VirtualHost's DocumentRoot directory, is to create an Alias...

Inside the VirtualHost block add:

Alias /blog /var/www/wp

<Directory /var/www/wp>
    Options All
    AllowOverride All
    order allow,deny
    allow from all
</Directory>

*This assumes you have PHP enabled in some way for that directory.

这篇关于不同的文件夹的子文件夹网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆