Pretty URL .htacces code giving ERR_TOO_MANY_REDIRECTS

Permalink
Hi there,

Google send me an email saying that my site wasn't being indexed because of a redirect error in page
mydomain.com/concrete/images/

My host provider told me it is the .htaccess code. I have tested it taking out the pretty url code:
<IfModule mod_rewrite.c>
   RewriteEngine On
   RewriteBase /
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME}/index.html !-f
   RewriteCond %{REQUEST_FILENAME}/index.php !-f
   RewriteRule . index.php [L]
</IfModule>

and it stops the redirection error.

Does anybody know why is this or how to solve it?
Thank you!
V.

byvictoria
 
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
Do you have another htaccess file in the concrete/images folder?
What is in that folder other than images?
byvictoria replied on at Permalink Reply
byvictoria
Hi @wayboat
I have checked, it has only images and folders with images. It is a C5 original folder which I updated to RC4, but it is still having that redirection issue after I updated.
The actual link is this:

beautebook.com/concrete/images/

Thank you!

V.
byvictoria replied on at Permalink Reply
byvictoria
I was wondering why /concrete/images/ has to be accesible anyway. Wouldn't a non-index or disallow rule in the robots file solve the issue?
I have tested it over and over, I had non www to www redirection, but I took it away.

I left only the pretty url rerwrite rules, and when I do that, I get the INET_E_REDIRECT_FAILED error in that specific location (domain.com/concrete/images/)
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
Looking at the source code of your home page I see multiple references to http [your site name].
These should be edited to read https [your site name] for your site if you want to have a secure (SSL) site.
I suspect there is a redirect setup somewhere that tries to redirect from http to https
byvictoria replied on at Permalink Reply
byvictoria
Thank you @weyboat!

I did find some https links, I changed them to http. How do I know if the redirection issue is solved?
I put back the .html code for pretty url and non www to www redirection, and now
when I go to beautebook.com/concrete/images I get redirected tohttp://www.beautebook.com/index.php,... is that ok?
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
It works for me if I drop the index.php from the url, so I would say yes it is okay..
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
Looking at the browser console there are 20 images being called by..
packages/theme_long_story_short/themes/long_story_short/js/main.js?v1.1.1
They are called in the preload function but do not exist on the server?

EDIT
The list of missing files is:
/application/files/1414/5497/7720/Home162.png
/application/files/2514/5585/0050/FotoNike2.png
/application/files/5714/5585/0035/FotoMaria2.png
/application/files/1714/5495/7014/Book_Cover_Design_007-min.jpg
/application/files/1514/5546/6380/Book_Cover_Design_017.png
/application/files/6714/5495/8538/Book_Cover_Design_002-min.jpg
/application/files/4914/5495/7461/Book_Cover_Design_010_mod-min.jpg
/application/files/7914/5495/2147/Book_Cover_Design_011_mod.jpg
/application/files/5514/5495/8506/Book_Cover_Design_005-min.jpg
/application/files/9714/5495/8632/Book_Cover_Design_027-min.jpg
/application/files/8114/4700/6797/Pat_Hover.png
/application/files/1514/4700/7025/Rick_Hover.png
/application/files/2414/4700/6648/Olsen_Hover2.png
/application/files/7414/4700/6628/Silva_Hover.png
/application/files/7114/4700/6795/Tony_Hover.png
/application/files/2114/4699/7440/Tony2.png
/application/files/3214/4699/7439/Silva2.png
/application/files/2814/4695/1208/Rick.png
/application/files/3514/4693/9286/Pat.png
/application/files/2214/4695/1225/Olsen.png
byvictoria replied on at Permalink Reply
byvictoria
That's strange... thank you @weyboat
I have just deleted all of them and left only the /application/files/6215/2476/5886/Home162.png which I looked for its right address...

Now my .htaccess is this
AddType application/x-httpd-php70 .php
        # -- concrete5 urls start --
<IfModule mod_rewrite.c>
   RewriteEngine On
# Redirect to www
    RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$
    RewriteCond %{HTTPS}s ^on(s)|
    RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
   RewriteBase /
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME}/index.html !-f
   RewriteCond %{REQUEST_FILENAME}/index.php !-f
   RewriteRule . index.php [L]
RedirectMatch 301 /201/(.*) /premade-book-cover-catalog
RedirectMatch 301 /p/(.*) /
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
The problem still exists with your packages/theme_long_story_short/themes/long_story_short/js/main.js?v1.1.1 is still trying to preload those same missing images
Here is the first part of that javascript code..
$(document).ready(function() {
        console.log("main.js");
// preload images
        function preload(arrayOfImages) {
                $(arrayOfImages).each(function(){
                        $('<img/>')[0].src = this;
                        // Alternatively you could use:
                        // (new Image()).src = this;
                });
        }
        preload([
    '/application/files/1414/5497/7720/Home162.png',
    '/application/files/2514/5585/0050/FotoNike2.png',
   '/application/files/5714/5585/0035/FotoMaria2.png',
    '/application/files/1714/5495/7014/Book_Cover_Design_007-min.jpg',

There must be some method of resetting the list of preload images that the packages/theme_long_story_short/themes/long_story_short/js/main.js?v1.1.1 is loading.
ConcreteOwl replied on at Permalink Reply 1 Attachment
ConcreteOwl
Within your htaccess file you have several 301 redirects.
Examples ...
RedirectMatch 301 /book-cover-design-order-form-2-2   /book-cover-design-order-form
RedirectMatch 301 /book-cover-design-order-form-2/   /book-cover-design-order-form

Concrete5 provides a better method of redirecting, in the sitemap locate your page (book-cover-design-order-form) click the filename and select 'Location', enter the old urls as per the image I have attached.
Then edit your htaccess file to remove those 301 redirects.
byvictoria replied on at Permalink Reply
byvictoria
Thank you @weyboat...

You must have a browser cached site, I have deleted all the preload images but one...

I think maybe the concrete/images location is protected, and that is why is messing up redirection with pretty url code. I wonder why I am the only one with that issue...