【发布时间】:2014-03-30 16:33:45
【问题描述】:
我在正确修改 .htaccess 文件时遇到问题。 目标是在我的服务器上实现一个 Web 服务来处理 Apple 的 passkit 请求。
这很完美……几乎。因为我的意图是,当用户键入:www.domain.com 时,他应该被定向到 www.domain.com/index.php。这将是我希望他在访问我的网站时看到的常用 index.php。
当 Apples Server 尝试向我的 Web 服务发送请求时,它们应该被重定向到子文件夹 /server/index.php。调用 www.domain.com 时,这很好用 但是当调用任何不同的 URL 时,应该重定向,我得到一个错误: “发生了太多重定向......”
我希望重定向到 /server/index.php
如何正确修改我的配置文件? 我配置文件如下:
<IfModule mod_rewrite.c>
RewriteEngine On
# If file with specified name does not exist, procede to rewrite rule below
RewriteCond %{REQUEST_FILENAME} !-f
# if request = root
RewriteRule ^/?$ /index.php
# else
RewriteRule !^/?(index\.php)$ www.medifaktor.de/server/index.php [R=301]
# Check for HTTP Header Authorization and if so, import it as a server environment variable into PHP
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] [L]
</IfModule>
【问题讨论】:
标签: php apache .htaccess mod-rewrite redirect