Forum Topic: After redirect index.php Ajax Error Detected

Forum: .htaccess Forum : Redirecting • Posted by Rahat Hossen • Updated:

On of my client website i use bellow code remove index.php from URL.

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

RewriteEngine On
RewriteRule ^(.*)$ /index.php [L,NC]

After using this code Ajax Error Detected

https://dl.dropboxusercontent.com/u/94213641/me/admin-ajax.png

If i remove this code than Ajax load properly.

RewriteEngine On
RewriteRule ^(.*)$ /index.php [L,NC]

Now what is the solution to hide index.php without ajax error

thank you.

1 Reply to “After redirect index.php Ajax Error Detected”

Posted by Jeff Starr

Hi Rahat,

Glad to help, may I ask what you are trying to accomplish?

I ask because the code you mention:

RewriteRule ^(.*)$ /index.php [L,NC]

..this code redirects all requests to the root index.php file, which is going to break a lot of stuff (including Ajax).