Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

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);
        })
      });
share|improve this question
    
Can you be a bit more specific about your issue? How are you getting a 404 error if the data is returned? –  m0r7if3r Mar 2 '12 at 15:27
    
@m0r7if3r - That's what I don't understand. I can see the data in Firebug, but the jQuery to output my feedback stops working and Firebug says I have a 404 error. –  Steven Mar 2 '12 at 18:36
    
As in you can see data coming out? Because if data is being returned and you have a 404, something WAY weird is going on. –  m0r7if3r Mar 2 '12 at 18:39
    
@m0r7if3r - Yes, something weird is going on. If I paste this URL directly in the browser, the data is returned and outputted, but it also gives a 404 message... –  Steven Mar 2 '12 at 18:42
    
Are you posting the request through admin-ajax.php? –  m0r7if3r Mar 2 '12 at 18:48
show 1 more comment

closed as too localized by toscho Jan 2 '13 at 23:00

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer

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

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.