Welcome Guest, Not a member yet? Register   Sign In
strange redirects urlS
#1

Hello!

Checking my SEO search console, I found strange urls without indexing, it should redirect to 404 or 301, but it redirects me with NS_ERROR_REDIRECT_LOOP and the search console warns me of the wrong redirect.

The urls are like "/index.phpproduct/R?3447087=uscrivesv", "/index.phpreview/item/list", "/index.phpconfig/login"," /index.phpproduct/S?2552902=znonpraedialy" and much others...

my CI4 htaccess
Code:
# Redirect Trailing Slashes...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]

# Rewrite "www.example.com -> example.com"
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]

# Checks to see if the user is attempting to access a valid file,
# such as an image or css document, if this isn't true it sends the
# request to the front controller, index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([\s\S]*)$ index.php/$1 [L,NC,QSA]

# REDIRECT HTTPS
RewriteCond %{HTTP:X-Forwarded-Proto} !https
    RewriteCond %{HTTPS} off
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# REDIRECT 301 WITHOUT WWW
    RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]

# REDIRECT 301 WITHOUT //
RewriteCond %{THE_REQUEST} //
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]

# REDIRECT 301 WITHOUT INDEX.PHP
RewriteCond %{HTTP_HOST} ^(www\.)?(.+)$ [NC]
RewriteRule ^index\.php$ / [R=301,L]
RewriteCond %{THE_REQUEST} \s/index\.php [NC]
RewriteRule ^(.*)index\.php/(.*)$ https://%{HTTP_HOST}/$1$2 [R=301,L]
Reply
#2

(This post was last modified: 10-01-2024, 08:38 AM by advanceconsent. Edit Reason: wrong )

The URLs such as `/index.phpproduct/R...` are missing slashes between `index.php` and the path. This can cause routing issues in CodeIgniter or trigger the redirect loop. You should make sure your URL generation function in your application is properly constructing URLs with the correct structure.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB