douchu4048 2012-04-17 14:55
浏览 30
已采纳

在实时服务器中设置zend项目[关闭]

Actually, I have created account in 000webhost.com free hosting, I uploaded system successfully. But I am able to run it only through this link aubergeikaze.netne.net/public/. The server is based on Apache:

//////////////////////.htaccess file \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
# Do not remove this line, otherwise mod_rewrite rules will stop working

RewriteBase /
/////////////////////////////////////////////////////////////////////

How can I configure http://aubergeikaze.netne.net/public/ to http://aubergeikaze.netne.net/ server in Apache. Thanks

  • 写回答

1条回答 默认 最新

  • douweilaton2762 2012-04-18 06:10
    关注

    One solution is documented in Zend Framework on a shared host

    Essentially, you need an index.php and a .htaccess file in the root folder as that's where Apache is serving from.

    index.php:

    <?php 
    define('RUNNING_FROM_ROOT', true);
    include 'public/index.php';
    

    .htaccess:

    SetEnv APPLICATION_ENV production
    
    RewriteEngine On
    RewriteRule .* index.php
    

    You'll also need to sort out the paths to static assets like CSS and JS files. You can either change the paths to include public/ or write a plugin to to it for you.

    Another option as noted in the comments to this answer (formatted here for readability):

    Create an .htaccess file into root folder with this content:

    RewriteEngine On 
    RewriteRule ^\.htaccess$ - [F] 
    RewriteCond %{REQUEST_URI} ="" 
    RewriteRule ^.*$ /public/index.php [NC,L] 
    RewriteCond %{REQUEST_URI} !^/public/.*$ 
    RewriteRule ^(.*)$ /public/$1 
    RewriteCond %{REQUEST_FILENAME} -f 
    RewriteRule ^.*$ - [NC,L] 
    RewriteRule ^public/.*$ /public/index.php 
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 chaquopy python 安卓
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 CSS实现渐隐虚线框
  • ¥15 有没有帮写代码做实验仿真的
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥30 vmware exsi重置后登不上
  • ¥15 易盾点选的cb参数怎么解啊
  • ¥15 MATLAB运行显示错误,如何解决?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容