2012-09-25 67 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的重寫工作,所以我假設如此。 –