.htaccess打破了我的阿贾克斯

时间:2014-04-14 19:52:07

标签: 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} ^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>

Chrome给我的错误如下:

Failed to load resource: the server responded with a status of 404 (Not Found) 
http://jolinmasson.com/ajax/page:6?_=1397504793977

1 个答案:

答案 0 :(得分:0)

最后设法使用.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>