gpt4 book ai didi

.htaccess - Codeigniter .htaccess 不忽略目录

转载 作者:太空宇宙 更新时间:2023-11-03 15:49:35 24 4
gpt4 key购买 nike

我有一个基于 codeigniter 的网站,我正在尝试让 PP IPN 与它一起工作。我看过几个 CI 特定库,但想要一个独立的 IPN 文件。

基本上,我在网站根目录中安装了 CI,并且在根目录中还有另一个目录“pp”。

我正在尝试使用 Paypal 的沙箱测试 IPN,但它返回 404,我也无法直接访问该文件。

这是我的 .htaccess 文件:

XSendFile on
Options -Indexes
Options +FollowSymlinks
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

### Canonicalize codeigniter URLs
RewriteRule ^(index(/index)?|index(\.php)?)/?$ / [L,R=301]
RewriteRule ^(.*)/index/?$ $1 [L,R=301]

# Removes trailing slashes (prevents SEO duplicate content issues)
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)/$ $1 [L,R=301]

RewriteCond %{HTTP_HOST} !^(www) [NC]
RewriteRule ^(.*)$ http://www.mysite.net/$1 [L,R=301]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|pp|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
# Without mod_rewrite, route 404's to the front controller
ErrorDocument 404 /index.php
</IfModule>

希望这是非常明显的事情!

谢谢,

瑞安

最佳答案

如果 pp 目录存在,您可以在该目录中放置一个 htaccess 文件,然后:

RewriteEngine On

它本身,主 htaccess 文件中的任何规则都将被忽略。如果您的 paypal 东西已经在 pp 目录中的 htaccess 文件中有重写规则,您可能需要查看这些规则作为 404 的原因。

关于.htaccess - Codeigniter .htaccess 不忽略目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12577077/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com