Title: error 404
Last modified: September 30, 2021

---

# error 404

 *  [albertpasto](https://wordpress.org/support/users/albertpasto/)
 * (@albertpasto)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/error-404-71/)
 * It returns me 404 error to old links. If I create new links, no problem
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ferror-404-71%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Plugin Contributor [nwjames](https://wordpress.org/support/users/nwjames/)
 * (@nwjames)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/error-404-71/#post-14933547)
 * [@albertpasto](https://wordpress.org/support/users/albertpasto/),
    When you enter
   a URL like `http://coralmaristes.cat/documents/2021/04/adiosnonino.pdf`since 
   it is not a file at this address, it will do via the rewrite rules.
 * The delivered rule for this, if active, will transform this input into
    `http://
   coralmaristes.cat/index.php?year=2021&monthnum=04&document=adiosnonino`
 * When I enter that URL, I could not find that document.
 * I entered `http://coralmaristes.cat/documents/` which should return a list of
   all published oocuments and it returned a list of 7 documents – 2 of which returned
   a 404.
 * “adiosnonino” was not amongst them.
 * This needs to be the post_name of the document post.
 * Possibly an initial check is to ensure that the Permalinks are refreshed by going
   to Settings -> Permalinks and clicking on the Save Changes button. You should
   not change anything.
 * Hope that this gives you some pointers to resolving the issue.
    Neil James
 *  Thread Starter [albertpasto](https://wordpress.org/support/users/albertpasto/)
 * (@albertpasto)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/error-404-71/#post-14933803)
 * No. I have already updated the permanent links. Out of order.
    I think the broken
   links originated from a web server change. Most of them work, but for some reason,
   a few dozen have broken. In fact, the appearance of the pluggin itself next to
   the administrator is different.
 * [https://photos.app.goo.gl/McYs5afijJLe6DSi7](https://photos.app.goo.gl/McYs5afijJLe6DSi7)
 *  Plugin Contributor [nwjames](https://wordpress.org/support/users/nwjames/)
 * (@nwjames)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/error-404-71/#post-14937080)
 * [@albertpasto](https://wordpress.org/support/users/albertpasto/),
    Thanks for
   this. You have noted a difference in the screen between the two documents. The
   document _tourdion_ contains a Revisions metabox (Registro de Revisiones) whereas
   _cantares_ does not.
 * This box is produced if the field post_content of the document is not empty. 
   This field should contain the ID of the attachment post – that is, the PDF file
   itself.
 * If it is empty, then I would not expect you to be able to display a document.
 * If you have this data corruption, you could see the attachments in the Media 
   library with attachment names like 7c30f7f466e79296d111ce60ec48690e.pdf. If you
   are able to see the attachment’s post_parent field, then this is the document
   to which it belongs.
 * If you have access to SQL, e.g. with PHPMyAdmin, then you can run this SQL:
 * `SELECT post_parent FROM`wp_posts` where post_type = ‘attachment’
    AND post_parent
   IN (SELECT id FROM `wp_posts` where post_type = ‘document’ and post_content =”);`
 * I have used the standard wp_ as the table prefix. Yours may be different.
 * If you get any results, then for each result XXX in turn, run
 * `SELECT * FROM`wp_posts`where XXXX in (id, post_parent)`
 * If the post_content field of the document record is empty, then it needs to be
   set to the highest attachment id.
 * Regards,
    Neil James
 *  Thread Starter [albertpasto](https://wordpress.org/support/users/albertpasto/)
 * (@albertpasto)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/error-404-71/#post-14944244)
 * please can you check the SQL statement (gives me error), there is some wrong 
   symbol and i am not phpmyadmin expert
    thanks
 *  Plugin Contributor [nwjames](https://wordpress.org/support/users/nwjames/)
 * (@nwjames)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/error-404-71/#post-14947546)
 * [@albertpasto](https://wordpress.org/support/users/albertpasto/).
    Apologies.
   I think that the issue aorise because the character used to start/end code within
   the replies here was used within the text:
 *     ```
       SELECT post_parent FROM wp_posts where post_type = ‘attachment’
       AND post_parent IN (SELECT id FROM wp_posts where post_type = ‘document’ and post_content = ”);
       ```
   
 * `SELECT * FROM wp_posts where XXXX in (id, post_parent)`
 * I have removed its use within the SQL statements itself. The highlighting should
   appear slightly differently.
 * Regards,
    Neil James
 *  Plugin Contributor [nwjames](https://wordpress.org/support/users/nwjames/)
 * (@nwjames)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/error-404-71/#post-14947580)
 * [@albertpasto](https://wordpress.org/support/users/albertpasto/),
    I tested copy/
   paste into PHP<yAdmin from the resulting entry and it didn’t work.
 * Please use this for the first SQL – and I hope that I won’t have to try again:
 *     ```
       SELECT post_parent FROM wp_posts 
       where post_type = "attachment" AND post_parent IN 
       (SELECT id FROM wp_posts where post_type = "document" and post_content = "")
       ```
   
 * Neil James
 *  Thread Starter [albertpasto](https://wordpress.org/support/users/albertpasto/)
 * (@albertpasto)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/error-404-71/#post-15003894)
 * after manually correcting more than 70 files, now, when I upload a new file “
   correct_name.pdf” and consult the file manager of the server, it has renamed 
   the file to “k556treki579.pdf” or similar.
    Who changes these names? Thank you
   so much.
 *  Plugin Contributor [nwjames](https://wordpress.org/support/users/nwjames/)
 * (@nwjames)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/error-404-71/#post-15016851)
 * [@albertpasto](https://wordpress.org/support/users/albertpasto/),
    What you are
   seeing is a fundamental featurr of the system – and it has always worked like
   this.
 * If you go to the plugin page and look under Features, you’ll see a section entitled
   Enterprise Security. Here it describes what it is doing.
 * It happens as you upload the file. The system r0es to some effort to hide the
   real file name so that you cannot access the file directly via the file system
   and not via WordPress.
 * Within WP, you have a document post with a title correct_name (or not) which 
   is used to retrieve the document. When the file is loaded (as an attachment post)
   its name is changed as described and no trace of the original name is kept.
 * Hope this clarifies,
    Neil

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘error 404’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-document-revisions_6c6c6c.svg)
 * [WP Document Revisions](https://wordpress.org/plugins/wp-document-revisions/)
 * [Support Threads](https://wordpress.org/support/plugin/wp-document-revisions/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-document-revisions/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-document-revisions/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-document-revisions/reviews/)

 * 8 replies
 * 2 participants
 * Last reply from: [nwjames](https://wordpress.org/support/users/nwjames/)
 * Last activity: [4 years, 7 months ago](https://wordpress.org/support/topic/error-404-71/#post-15016851)
 * Status: not resolved