Php .htaccess破坏了我的ajax
我尝试用.htaccess删除url的index.php部分,现在ajax内容将不再加载,即使我删除了.htaccess。以下是.htaccess的外观: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
<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>