【发布时间】:2014-02-13 18:07:42
【问题描述】:
我在一个 ec2 redhat 实例上运行 Apache。我使用 conf.d/ssl.conf 启用并运行了 https。我正在尝试重写 url,以便用户不必添加 .php 扩展名。但是,由于某种原因,它不起作用。这是我添加到 ssl.conf 中的内容:
<VirtualHost _default_:443>
# General setup for the virtual host, inherited from global configuration
DocumentRoot "/var/www/https-html"
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteCond %{REQUEST_URI} !/$
RewriteRule (.*) $1\.php [L]
.
.
.
</VirtualHost>
我得到一个没有 .php 扩展名的 404,并且它与扩展名一起工作正常。
【问题讨论】:
标签: apache mod-rewrite