Quantcast
Channel: Joomla! Forum - community, help and support
Viewing all articles
Browse latest Browse all 2156

General Questions/New to Joomla! 5.x • Images being redirected

$
0
0
Hello,

I've got the following redirects in my .htaccess:
# Enable the rewrite engine
RewriteEngine On

# Custom 404 error handling
ErrorDocument 404 /404-handler.php

# Redirect 404 errors containing 'artigos' or 'blog' to URL1
RewriteCond %{REQUEST_URI} artigos [NC,OR]
RewriteCond %{REQUEST_URI} /item/ [NC,OR]
RewriteCond %{REQUEST_URI} /blog [NC]
RewriteRule .* https://www.portal-gestao.com/posts.html [R=301,L]

And the following PHP handler:
<?php
// Set the response code to 404
http_response_code(404);

// Check the request URI for specific keywords
if (preg_match('/artigos|\/item\/|\/blog/i', $_SERVER['REQUEST_URI'])) {
header("Location: https://www.portal-gestao.com/posts.html");
exit;
} elseif (preg_match('/comprar-curso/i', $_SERVER['REQUEST_URI'])) {
header("Location: https://www.portal-gestao.com/cursos-online.html");
exit;
}

// Display a 404 error page or handle as needed
echo "404 Not Found";
?>


Although I've disabled these redirects and this handler file, the images within the posts, like:
https://www.portal-gestao.com/images/ar ... mate_2.png

Are redirecting to:
https://www.portal-gestao.com/posts.html

There are no other redirects in .htaccess and I can't figure out why on earth is this redirecting happening.

Can anyone help?

Statistics: Posted by tigger — Thu Jul 04, 2024 3:19 pm



Viewing all articles
Browse latest Browse all 2156

Trending Articles