Apache php 单一入口 丢失Post数据
phpcn_u1317
phpcn_u1317 2017-03-30 17:17:41
0
1
1199

场景:把单向入口做的跟彻底,即把访问文件夹或不存的文件指向index.php入口。于是把.htaccess中的 RewriteCond %{REQUEST_FILENAME} !-d 注释掉。

最终配置如下:

<IfModule mod_rewrite.c> 

Options +FollowSymlinks

RewriteEngine on 

#RewriteCond %{REQUEST_FILENAME} !-d 

RewriteCond %{REQUEST_FILENAME} !-f 

RewriteRule ^(.*)$ index.php/$1

</IfModule>


这样就出现问题了

例:项目App中有个目录Api

https://xxxx/Api 这样访问就会丢失Post数据

https://xxxx/Api/ 这样访问不会丢失Post数据

当Api目录不存在是两种访问都没问题


phpcn_u1317
phpcn_u1317

Antworte allen(1)
数据分析师

Apache php 单一入口 丢失Post数据-PHP中文网问答-Apache php 单一入口 丢失Post数据-PHP中文网问答

围观一下哦,学习一下。

Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage
Über uns Haftungsausschluss Sitemap
Chinesische PHP-Website:Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!