[英]mod rewrite issue with htaccess using Slim Framework
我正在为客户开发应用程序,他们在该网站上拥有一些wordpress博客, 网址为http://www.chasethepaper.com
在根目录中,htaccess文件是
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/(yumninja_app_1_0|yumninja_app_1_0/.*)$
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
在根里面,我有一个名为
'yumninja_app_1_0'
在“ ap”文件夹中,我有一个htaccess
如果您访问http://chasethepaper.com/yumninja_app_1_0/api/
它会显示索引页面,但是如果您转到
http://chasethepaper.com/yumninja_app_1_0/api/getReviews它返回wordpress 404
这是api文件夹内的htaccess文件
RewriteEngine On
# Some hosts may require you to use the `RewriteBase` directive.
# If you need to use the `RewriteBase` directive, it should be the
# absolute physical path to the directory that contains this htaccess filwe.
#
# RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^/(yumninja_app_1_0|yumninja_app_1_0/.*)$
RewriteRule ^(.*)$ index.php [QSA,L]
<IfModule Mod_php.c>
php_value upload_max_filesize 10M
php_value post_max_size 20M
php_value memory_limit 32M
</IfModule>
我真的不确定为什么这不起作用。 是几天前 我知道/ getReviews是有效的,因为我将相同的文件夹结构复制到另一个服务器,并且可以正常使用http://javadash.com/yumninja_app_1_0/api/getReviews
如果服务器是apache,请检查error.log文件,它应该提供有关问题所在的有用信息。
我想到了。 那是因为我有
RewriteCond %{REQUEST_URI} !^/({app_name}|{app_name}.*)$
在api文件夹中的.htaccess文件中。 一旦我删除它,它就可以了
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.