Permalink changes gives me 404

Up til now, I’ve used /%postname%/. Now I have changed this to /%category%/%postname%/. I know WP does not recommended to use category / psotname, but it makes a lot more sense for users.

Opening pages and posts work fine. What crashes are all my jQuery calls to jQuery.php file. The data is actually returned, but when trying to output the data, I get a 404 error.

Read More

Data process:

**Fetch data**  
Ajax request -> jQuery.php -> some.class.php -> database

**Return data**  
database -> some.class.php -> json_encode($result) -> 404 error

Does anyone know how I can fix this problem? Do I have to change my .htaccess file?

Update

This is the .htaccess file

# 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

Error message:

“NetworkError: 404 Not Found –
http://mysite.com/wp-content/themes/mysite/include/jquery.php?instance=search&limit=25&term=ac

Respons tab in Firebug shows this:

[{"id":"221","value":"Acne","url_name":"Acne"},{"id":"7176","value":"Acne Jeans","url_name":"Acne+Jeans"}]

In this case I’m expecting a autosuggest answer.

If I paste this URL directly in browser, I get the result on the screen, but i also get a 404 error message.

This is a typical jQuery request:

      jQuery.ajax({
        url: siteURL +"/wp-content/themes/mysite/include/jquery.php",
        data: {
          instance: 'addPerson',
          name: 'Jon Doe',
          age: '26'
        },
        dataType: 'json',
        success: (function(data) {
          showFeedback(data);
        })
      });

Related posts

Leave a Reply

1 comment

  1. Is your rewrite rule in your .htaccess well configured?
    Can you post it here?

    Should be configured like this:

    # 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
    

    Source:
    Codex page on pretty permalinks