2012-09-25 69 views
2

我有一个建立在codeigniter上的网站,我正试图让PP IPN与它一起工作。我查看了一些CI特定的库,但想要有一个独立的IPN文件。Codeigniter .htaccess不会忽略目录

基本上,我有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> 

在这里我们希望这件事情真的很明显!

感谢,

瑞安

回答

1

如果pp目录存在,你可以只是把一个htaccess文件,在该目录中,只是有:

RewriteEngine On 

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

0

你有启用mod_rewrite.c。如果没有,该.htaccess将始终提供404.(对不起,我不能让这个评论,没有代表)。

+0

非www到www的重写工作,所以我假设如此。 –