【发布时间】:2017-06-30 13:50:20
【问题描述】:
这在 localhost 上运行良好: 但不适用于我的托管网站(由 Hostinger.fr 提供)
RewriteBase /
RewriteEngine On
RewriteCond expr "%{REQUEST_URI} -strmatch '*admin/*'"
RewriteRule (.*) $1 [L]
RewriteCond expr "%{REQUEST_URI} -strmatch '*journal/*'"
RewriteRule (.*) $1 [L]
RewriteRule (.*) webroot/$1 [L]
这些行之后(在处理之后)是另一个指向 webroot 目录的 htaccess:
RewriteBase /
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*) index.php/$1 [L]
它用于向我显示第一页,因为 index.php 存在于那里的 webroot 目录中,但不显示内部页面。 我使用MVC结构对站点进行编码,并且没有直接指示调用的程序 通过单击 index.php 页面显示的菜单中的一个选项,它只向我显示一个带有消息“未指定输入文件”的空页面。 webroot index.php 没有被调用(像第一次那样)以继续开发真正的程序来调用。
谁能建议我在 .htaccess 中需要做什么?
注意:Hostinger 希望“Rewrite Base /”命令必须放在首位
【问题讨论】:
标签: php .htaccess web-hosting