[英]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.