我有一个像这样的文件夹结构
Controller
|_check.php
View
|_ .htaccess
|_ index.php
|_ Webroot
|_ js
|_common.js
.htaccess
在 .htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ View/ [L]
RewriteRule (.*) View/$1 [L]
</IfModule>
在视图/.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>
外部 .htaccess 文件链接到 View 文件夹,并View/.htaccess
链接到 index.php。
index.php
(查看文件)中有带有 ajax的按钮check.php
。
我给了 common.js 对应的 ajax 函数 url 为
var url = 'check.php'; // OR '../Controller/check.php'
问题是 ajax 不能与两个 url 一起正常工作。
我是否需要更改文件夹结构以更正它,或者我是否需要更改任何 htaccess 文件以访问check.php
?