【问题标题】:How to properly configure the .htaccess of Typo3 to run realurl如何正确配置 Typo3 的 .htaccess 以运行 realurl
【发布时间】:2016-03-02 16:04:54
【问题描述】:

我是typo3 的新手,我目前的任务是让realurl 正常工作。在研究了许多教程和官方文档后,我得到了 realurl,链接按预期正确转换。

即使在测试了多个解决方案后我也没有得到解决的问题是 apache 服务器的错误行为(通过 .htaccess、mod_rewrite 配置)。它正确地忽略了对uploads/fileadmin/typo3conf 的重写,但在涉及错字页面时从不将url 重写为index.php。

这里是对应的 .htaccess 条目:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule ^typo3$ - [L]
    RewriteRule ^typo3/.*$ - [L]
    RewriteRule ^uploads/.*$ - [L]
    RewriteRule ^fileadmin/.*$ - [L]
    RewriteRule ^typo3conf/.*$ - [L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-l
    RewriteRule (.*[^/])$ http://%{HTTP_HOST}/$1/ [L,R]

    RewriteCond %{REQUEST_FILENAME}/index.html -f
    RewriteRule / %{REQUEST_URI}/index.html [L]

    RewriteCond %{REQUEST_FILENAME}/index.htm -f
    RewriteRule / %{REQUEST_URI}/index.htm [L]

    RewriteCond %{REQUEST_FILENAME}/index.php -f
    RewriteRule / %{REQUEST_URI}/index.php [L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-l
    RewriteRule * /index.php
</IfModule>

有人知道这个配置有什么问题吗?我有点绝望:(

提前致谢, 托马斯

【问题讨论】:

  • 给出 TYPO3 和 Apache 的版本,同时检查是否通过phpinfo() 启用了 mod_rewrite。实际上忽略重写路径看起来与未启用 mod_rewrite 相同 - 它什么都不做。
  • 只是一个疯狂的猜测:你的服务器不支持 url 重写。可能 mod_rewrite 没有启用。

标签: mod-rewrite typo3 realurl


【解决方案1】:

最好用重写日志解决:https://wiki.apache.org/httpd/RewriteLog

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-04-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-11-10
    • 1970-01-01
    • 2013-10-18
    相关资源
    最近更新 更多