0

最近在 UBUNTU 上使用 MURA CMS 和 RAILO。我正在根目录的内部文件夹中安装 MURA。

public_html >> 网站。

在 .htaccess 中添加以下代码以重写 URL 以在没有 index.cfm 和网站目录的情况下运行网站。

Options +FollowSymLinks
RewriteEngine On 
DirectoryIndex index.cfm
RewriteRule ^$ /website/ [R]
RewriteCond  %{DOCUMENT_ROOT}%{REQUEST_URI}  !-d
RewriteRule ^website/([a-zA-Z0-9/-\s]+)$ /website/index.cfm/$1 [PT]

所以我的网址http://example.com/website/privacy/重写为 http://example.com/website/index.cfm/privacy/ 我认为重写规则应该可以正常工作,因为我尝试了一些在线验证器并给了我正确的结果,但如果在 MURA 中运行它会产生类似 http://example.com/website/index.cfm/privacy/index.cfm的 URL

我不确定是谁在添加最后一个 index.cfm(apache 或 mura),这每次都将我带到 404 页。

请帮助...这让我发疯..

谢谢,普利特什

更新 我在 root 的子文件夹下使用 windows/IIS 7 设置了相同的站点并且可以正常工作,如果有帮助的话

4

2 回答 2

2

要删除 URL 的 index.cfm,您必须编辑文件settings.ini.cfm 要编辑此文件

  1. 转到模块/文件管理器
  2. 然后标签Application Root
  3. 选择文件夹config
  4. 然后右键单击 settings.ini.cfm 并编辑
  5. 在这个文件中,siteidinurls并且indexfileinurls必须在0

    siteidinurls=0 indexfileinurls=0

更改后,您必须通过单击窗口顶部的菜单Reload application重新加载应用程序。Settings

于 2013-05-13T13:34:03.323 回答
0

感谢 Matt 和 Mael 为这个问题花时间。最后弄清楚 TOMCAT 引起了问题并在最后添加了 index.cfm。

<url-pattern>/website/index.cfm/*</url-pattern>

在 web.xml 文件中添加上述 URL 模式,它开始正常工作。

于 2013-05-15T10:10:24.793 回答