-
AuthorPosts
-
September 19, 2024 at 6:17 pm #1467476
Hallo,
die Medien haben bei mir alle einen Permalink.
Beispiel: https://www.kunleisys.com/dilly-oswald-huettenhof-buchau/Wie kann ich verhindern das die Medien/Bilder über einen Link aufgerufen werden können.
Danke!September 20, 2024 at 5:07 am #1467505Hey Reinhard,
Thank you for the inquiry.
Please try to use one of the following plugins to help protect your media files:
// https://wordpress.org/plugins/prevent-direct-access/
// https://wordpress.org/plugins/wp-content-copy-protector/If the site is hosted on Apache, you can also add this rule to the .htaccess file, but it may affect the indexability of the images:
<FilesMatch "\.(jpg|jpeg|png|gif|pdf)$"> Order Deny,Allow Deny from all Allow from yourdomain.com </FilesMatch>
`
Best regards,
IsmaelSeptember 20, 2024 at 8:24 am #1467519Hallo Ismael,
danke.
Vielleicht habe ich mich falsch ausgedrückt. Ich will nicht “jpg|jpeg|png|gif|pdf” schützen.Ich möchte nicht das Medien einen Permalink: https://www.kunleisys.com/riederalm-front/ oder https://www.kunleisys.com/riederalm-front/ haben.
September 21, 2024 at 11:45 am #1467557Hi,
Thanks for the update. Maybe this will help you out? https://www.greengeeks.com/tutorials/set-wordpress-to-disable-attachment-pages-for-media/
Best regards,
RikardSeptember 23, 2024 at 11:14 am #1467652Danke über Yoast funktioniert es oder über die function.php
// Disable attachment pages
function pressengers_redirect_attachment_page() {
if ( is_attachment() ) {
global $post;
if ( $post && $post->post_parent ) {
wp_redirect( esc_url( get_permalink( $post->post_parent ) ), 301 );
exit;
} else {
wp_redirect( esc_url( home_url( ‘/’ ) ), 301 );
exit;
}
}
}
add_action( ‘template_redirect’, ‘pressengers_redirect_attachment_page’ );September 23, 2024 at 2:24 pm #1467668Hi,
Thanks for sharing. Please let us know if you should need any further help on the topic, or if we can close it.
Best regards,
RikardSeptember 23, 2024 at 2:41 pm #1467671You can close it.
September 23, 2024 at 4:04 pm #1467676Hi,
Thanks for letting us know. Please open a new thread if you should have any further questions or problems.
Best regards,
Rikard -
AuthorPosts
- The topic ‘Permalink’ is closed to new replies.