【问题标题】:RealURL problems when using TYPO3 and Magento in one webroot在一个 webroot 中使用 TYPO3 和 Magento 时的 RealURL 问题
【发布时间】:2013-07-15 09:32:45
【问题描述】:

我们有以下设置:

webroot 包含两个目录。一个用于 Magento,一个用于 TYPO3。

我有一个额外的 ht.access 应该重写一些 url 以使用 TYPO3。其他一切都应该交给 Magento。这个 htaccess 看起来像这样:

<IfModule mod_rewrite.c>

Options -Indexes

Follow Symlinks

Options +FollowSymLinks
Enable URL rewriting
RewriteEngine On
RewriteRule ^$ /cms/index.php [L]

RewriteRule ^kurse(.*)$ /cms/index.php [L]
RewriteRule ^service(.*)$ /cms/index.php [L]
RewriteRule ^kontakt(.*)$ /cms/index.php [L]
RewriteRule ^informationen(.*)$ /cms/index.php [L]
RewriteRule ^typo3$ /cms/typo3/index.php [L]

RewriteRule ^(.*)$ /shop/index.php [L]

</IfModule>

现在,当我调用 url 时,假设 http://host/informationen RealURL 将其重定向到 http://host/cms/rmationen,这会导致“路径段错误”

我也尝试过 / 和 /cms/ 作为 RewriteBase。没有按预期工作。

是否有任何解决方法可以使用一个域实现两个系统?

干杯 马蒂亚斯

【问题讨论】:

  • 你想重定向还是重写?
  • 我需要重写。出于 SEO 的原因,我不想在 url 中有像“cms”这样的路径段。

标签: .htaccess typo3 realurl


【解决方案1】:

您应该首先放置“cms”重定向块,因为 [L] 会停止所有进一步的处理。

【讨论】:

  • ps:如果你只有 4 个内容页面,添加typo3 是大材小用。您可以使用 magento 的内置 cms 功能或轻量级 php cms,例如 www.grabaperch.com - 当然这只是一种意见
  • 对不起,我弄错了。商店改写已经在底部了。
  • 我们有很多页面。它们都以“kontakt,...”开头
  • 只是一些提示:请参阅有关向路径添加附加目录的问题:stackoverflow.com/questions/5228901/… - 对于初学者,您没有在代码中将任何参数传递给目标 URL。重写看起来像 RewriteRule ^kontakt/(.*)$ /cms/kontakt/$1 [L]。再说一次,这可能与realURL无关,您可以将其关闭进行测试。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-11-06
  • 1970-01-01
  • 1970-01-01
  • 2023-03-24
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多