表达式引擎 - 模板页面未显示

发布于 2024-12-03 04:47:35 字数 831 浏览 1 评论 0原文

我刚刚完成的网站上有两个页面不再显示。我正在运行 EE 2.2.2 并使用 .htaccess 隐藏索引页。

同一目录中有多个模板,除了两个模板外,所有模板均正确显示。例如:

这显示正确: http://southernlivingplants.com/landscape

虽然这两个没有:

http://southernlivingplants.com/grower
http://southernlivingplants.com/retailer

我收到以下错误消息:

/零售商索引

父目录

Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 服务器 在 Southernlivingplants.com 端口 80

我看到的问题是 /retailer/grower 都不是目录。

这是 htaccess 代码:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]

我希望得到一些帮助来解决这个问题。

I have two pages on a site that I just completed that are no longer showing. I am running EE 2.2.2 and use .htaccess to hide the index page.

There are several templates in the same directory, all but two of them show correctly. For example:

This shows correctly: http://southernlivingplants.com/landscape

While these two do not:

http://southernlivingplants.com/grower
http://southernlivingplants.com/retailer

I get the following error message:

Index of /retailer

Parent Directory

Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2
mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 Server
at southernlivingplants.com Port 80

The problem I see is that neither /retailer or /grower are directories.

Here is the htaccess code:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]

I would appreciate some help in figuring this out.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

双马尾 2024-12-10 04:47:35

唉,用户错误。其他人创建了同名的文件夹,这与模板名称冲突。

Alas, user error. Someone else had created folders of the same name, which were in conflict with the template names.

鸢与 2024-12-10 04:47:35

如果我将 index.php 放在 URL 中,页面似乎会出现,因此这可能是 .htaccess 问题。您是否已通过官方文档删除它?有几个选项: http://expressionengine.com/user_guide/general/remove_index.php.html

另一个想法...你说零售商和种植者都在同一个目录中?除非您使用 Structure,否则 EE 通常不会那样工作。模板组定义新的顶级目录,其中的每个模板都是一个子目录(索引除外)。因此,在这种情况下,如果它们都在 landscaping 目录中,则 url 将是 /landscaping/retailer 和 /landscaping/grower。希望有帮助!

If I put index.php in the URL the pages seem to come up, so it's probably an .htaccess issue. Have you been through the official docs for removing it? There's several options: http://expressionengine.com/user_guide/general/remove_index.php.html

Another idea...you said that retailer and grower are all in the same directory? EE doesn't generally work like that unless you're using Structure. Template groups define new top level directories and each template inside is a sub directory (other than the index). So in this case if they're all in the landscaping directory the urls' would be /landscaping/retailer and /landscaping/grower. Hope that helps!

梦魇绽荼蘼 2024-12-10 04:47:35

看起来您正在对 ExpressionEngine 的 .htaccess 文件使用“文件和目录检查”方法。

EE 中是否有零售商和种植者模板组或模板?

您尝试过删除吗?在重写规则中的index.php之后?您使用什么托管公司?

我自己使用“排除”方法取得了最大的成功。

您基本上

放入ReWriteCond 您不希望 EE 像模板一样解析的文件夹/文件。因此,您的 /images、/system、/themes 等目录,如果您最终有 /js 或其他应用程序的目录,只需将它们添加到该行即可。 (确保避开句点。)我建议尝试该方法。这样其他的事情肯定都会通过EE。

It looks like you are using the "File and Directory Check" method for the .htaccess file for ExpressionEngine.

Are retailer and grower template groups or templates in EE?

Have you tried removing the ? after the index.php in the rewrite rule? What hosting company are you using?

I have had best success with the "Exclude" method myself.

http://expressionengine.com/wiki/Remove_index.php_From_URLs#Exclude_List_Method

You essentially put in the ReWriteCond the folders / files that you do NOT want EE to parse as if it's a template. So, your /images, /system, /themes, etc directories, if you end up having one for /js or another application, you just add them to that line. (Make sure to escape the periods.) I suggest trying that method. That way everything else will definitely go through EE.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文