Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/268.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php .htaccess破坏了我的ajax_Php_Ajax_.htaccess - Fatal编程技术网

Php .htaccess破坏了我的ajax

Php .htaccess破坏了我的ajax,php,ajax,.htaccess,Php,Ajax,.htaccess,我尝试用.htaccess删除url的index.php部分,现在ajax内容将不再加载,即使我删除了.htaccess。以下是.htaccess的外观: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / # Removes index.php from ExpressionEngine URLs RewriteCond %{THE_REQUEST} ^GE

我尝试用.htaccess删除url的index.php部分,现在ajax内容将不再加载,即使我删除了.htaccess。以下是.htaccess的外观:

<IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteBase /

        # Removes index.php from ExpressionEngine URLs
        RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
        RewriteCond %{REQUEST_URI} !/system/.* [NC]
        RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]

        # Directs all EE web requests through the site index file
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>

最终,它成功地使用了这个.htaccess

<IfModule mod_rewrite.c>

RewriteEngine on
RewriteBase /

RewriteRule ^content/(.*)\.(txt|md|mdown)$ error [R=301,L]
RewriteRule ^site/(.*) error [R=301,L]
RewriteRule ^kirby/(.*) error [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php [L]

</IfModule>

重新启动发动机
重写基/
重写规则^content/(.*)\(txt|md|mdown)$error[R=301,L]
重写规则^site/(*)错误[R=301,L]
重写规则^kirby/(*)错误[R=301,L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则^(.*)index.php[L]

ajax以前工作过吗?是的。甚至连一个都没有。htaccess…
<IfModule mod_rewrite.c>

RewriteEngine on
RewriteBase /

RewriteRule ^content/(.*)\.(txt|md|mdown)$ error [R=301,L]
RewriteRule ^site/(.*) error [R=301,L]
RewriteRule ^kirby/(.*) error [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php [L]

</IfModule>