【问题标题】:redirecting domain to subdirectory with php or apache使用 php 或 apache 将域重定向到子目录
【发布时间】:2011-03-05 13:00:02
【问题描述】:
<IfModule mod_rewrite.c>
    RewriteCond %{HTTP_HOST} ^(www.)?url.com$
    RewriteRule ^(/)?$ www-static [L]
</IfModule>

好的,上面的 apache 配置运行良好。是的

url.com to url.com/www-static = www.myurl.com/www-static

1.我们可以在 apache 中做类似的事情吗?

url.com = www.myurl.com/www-static without adding the /www-static on the url ?

2。在 php 中怎么样?还是在apache上更好? (假设我们有数千个域重定向到我们从数据库中获取的特定文件夹)

感谢关注

亚当斋月

【问题讨论】:

    标签: php apache .htaccess redirect


    【解决方案1】:

    使用引导程序和 MVC 模式。通过这种方式,您可以检测引用 URL 并获取您想要显示的内容......这就是所有这些搜索引擎 cloaker 脚本的工作方式(听起来您正在尝试这样做)。

    【讨论】:

      猜你喜欢
      • 2017-04-04
      • 1970-01-01
      • 2011-06-28
      • 2010-12-17
      • 2012-09-07
      • 2011-06-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多