• Resolved nathan12343

    (@nathan12343)


    I’ve got a strange problem when I use pretty links %postname% and trigger a 404. When pretty links are off then the site displays the correct “No content” statement built into the theme files. But the moment I turn pretty links back on I get some strange extracts of the page code. Its seems that the page is being read from a few dozen lines of HTML in (so view source shows that <html…. etc is missing and it starts from somewhere in the body tag.

    It isn’t just one site that I have this on – all custom themes – and I don’t know what I am doing wrong.

    Anyone else had this? Any idea how I can solve it?

    Thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • Shane G.

    (@shane-g-1)

    Hi,

    Reset your desired permalink from wordpress admin area and add this code in htaccess:

    # BEGIN WordPress
    
    <IfModule mod_rewrite.c>
    ErrorDocument 404 /index.php?error=404
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress

    Thanks,

    Shane G.

    Thread Starter nathan12343

    (@nathan12343)

    Hi

    Thanks for this, unfortunately my .htaccess already looks like this. Well similar, the RewriteBaseand RewriteRulehave /wordpress. – the other thing that I didn’t mention was that my wordpress files are always in a different folder to the blog address (e.g. mydomain.com/wordpress/)

    You can see this error in action on a site I am working on at the moment. Compare:

    photoshoppingpong.com/fdhsjkfhksdh with photoshoppingpong.com/?page_id=4515315611

    Both are false pages, but the first displays badly.

    Thread Starter nathan12343

    (@nathan12343)

    Am I the only one getting this? It would be interesting to hear if anyone else with their wordpress files in a subfolder and running pretty links has the same issue. It would also be interesting to hear if you are not having the problem!

    jamie33lee

    (@jamie33lee)

    I’m experiencing exactly the same issue, and am nowhere near clearing up the issue.

    I wonder if you have the same issue as me:

    When you view the first page of a list of posts from a particular category they display fine, but when you click to view ‘Older’ links the partial source code is displayed?

    Interestingly, i have created another mysql database and installed wordpress in a subdirectory and 404 errors display a blank page

    Very Strange!

    Thread Starter nathan12343

    (@nathan12343)

    I don’t get it with the older posts. Mine only appears if I try to go to a pretty link that isn’t there. I have now put in a 404.php page which gives me an ironically preferable browser error!

    I’m still no closer to figuring this out.

    Thread Starter nathan12343

    (@nathan12343)

    I don’t know what is causing the problem but I have stumbled apon a solution. I hope this help the good wordpress people find out what is happening….

    When my site which is running on %post_name% pretty links returns a 404 about 7,800 characters are cut from the beginning of the html. The reason then that it appears to start at a random point will be what changes have been made in the header (e.g. a longer or shorter title).

    What I have done is create a 404.php and add about 7,800 spaces to line 1. This is now working absolutely fine. But it is so obviously not right!!!

    I hope this helps other people resolve any 404 issues. It would be interesting to hear if it is the same number for all sites

    (I didn’t count them myself I copied the line into Word and look at the doc properties!!)

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘pretty links and 404 errors’ is closed to new replies.