error 404
-
It returns me 404 error to old links. If I create new links, no problem
The page I need help with: [log in to see the link]
-
@albertpasto,
When you enter a URL likehttps://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
https://coralmaristes.cat/index.php?year=2021&monthnum=04&document=adiosnonino
When I enter that URL, I could not find that document.
I entered
https://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 JamesNo. 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.@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 FROMwp_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_postswhere 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 Jamesplease can you check the SQL statement (gives me error), there is some wrong symbol and i am not phpmyadmin expert
thanks@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@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
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.@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
- The topic ‘error 404’ is closed to new replies.