【问题标题】:How to do friendly URLs work with slashes in the end?最后如何使友好的 URL 与斜杠一起工作?
【发布时间】:2011-07-05 21:28:42
【问题描述】:

我的 .htaccess 文件具有当前设置:

Options -Indexes

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ $1\.php

当我输入 mydomain.com/file 时没问题,但是当我访问 mydomain.com/file/ 时出现错误 500。

没有名为“file”的文件夹,任何路径都会出现此问题。

【问题讨论】:

  • 您好,您有一个 nginx 问题:“我需要在 domain.com/es 中转 domain.com/?q=es”。页面不见了,但这里有一个答案: if ( $args ~ q=(..) ) { set $dom $1;重写 (.*) /$dom;休息;}

标签: apache .htaccess friendly-url seo


【解决方案1】:

尝试将 -MultiViews 添加到您的选项中。如果它仍然中断,请查看 apache error_log,您将获得有关问题的完整解释。

【讨论】:

    猜你喜欢
    • 2012-11-16
    • 2020-12-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-04-10
    • 2019-02-06
    • 2013-09-10
    • 2017-05-03
    相关资源
    最近更新 更多