dowaw80220 2015-11-15 14:12
浏览 21

.htaccess for OpenShift上的PHP

My directory structure is:

> app
   - controllers
   - core
   - includes
   - models
   - views
   - .htaccess
   - init.php
> public
   - css
   - fonts
   - images
   - js
   - .htaccess
   - index.php

The .htaccess file inside public directory is configured as:

Options -MultiViews
RewriteEngine On

RewriteBase /public

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]

And the one in app directory as:

Options -Indexes

I have hosted the application on OpenShift. Though this configuration works well locally but throws 500 Server Error on OpenShift. Help?

  • 写回答

1条回答 默认 最新

  • doumi0737 2015-11-15 16:01
    关注

    What is probably happening is that the 'public' directory is being selected as your document root, and the files in app are not web accessible because they are outside of the document root. You can see how the document root is chosen here (https://github.com/openshift/origin-server/blob/master/cartridges/openshift-origin-cartridge-php/usr/lib/php_config), you should also check your log files (https://developers.openshift.com/en/managing-log-files.html) to get more information about the error that is being generated.

    评论

报告相同问题?

悬赏问题

  • ¥170 如图所示配置eNSP
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改
  • ¥20 wireshark抓不到vlan
  • ¥20 关于#stm32#的问题:需要指导自动酸碱滴定仪的原理图程序代码及仿真
  • ¥20 设计一款异域新娘的视频相亲软件需要哪些技术支持
  • ¥15 stata安慰剂检验作图但是真实值不出现在图上
  • ¥15 c程序不知道为什么得不到结果
  • ¥15 键盘指令混乱情况下的启动盘系统重装