我在我的项目中使用了使用 Codeigniter 框架的 htaccess:
目录索引index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|assets|robots\.txt|favicon\.ico) [NC]
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.*)$ ./index.php/$1 [NC,L,QSA]
我的问题是,当我调用 Paypal 服务时,Paypal 为我响应一个 GET url,如下所示: http://xxx.xx.com/myproject/paypalCallback?tx=32J30607S6157364F&st=Pending&amt=85.00&cc=SGD&cm=&item_number=
我收到 404 页面未找到。 Htaccess 不接受 GET URL: ?tx=32J30607S6... 我确信它可以在本地工作,但不能在现场工作
如果可以的话,请帮帮我。 谢谢
最佳答案
是的,这在 CI 中有效
如果在 CI 中禁用它们,您仍然可以访问查询字符串,请尝试此代码
从 URL 中删除 index.php
RewriteEngine On
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
如果您的子目录中有 CI 应用程序,请使用此
RewriteBase /f2f/f2fweb
关于php - Htaccess Codeigniter问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5983126/