Jump to content

[Resolved] .htaccess Search.html ERR_TOO_MANY_REDIRECTS


Recommended Posts

I have been looking at CC6 as a product which I could use, but after doing a fresh install I get an error when it comes to the search section of the site.

The issue looks to do with the mod_rewrites, I'm using Chrome and have cleared all cach and cookies but still see the issue.


So looking into this a little is this something to do with the .htaccess rules i'm using?

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*)\.html?$ index.php?seo_path=$1 [L,QSA]

Also the URL string looks wrong : /search.html?_a=category&search[keywords]= as when looking at the demo site the URL string looks like this.


What am I missing when installing?? I've installed using a git clone of V6


Right, if I change the .htaccess file to:

RewriteRule ^(.*)\.html?$ index.php?seo_path=$1 [L] then I get the right URL string as the Live CC6 demo site on my local version:

search.html?search%5Bkeywords%5D=nn&_a=category But this doesn't do anything, it just shows the Advanced Search page. So any ideas to why 

[L,QSA] gives redirect loop errors? Anyone

Link to comment
Share on other sites

Welcome larryhawks! Glad to see you made it to the forums.

The .htaccess directives are correct:

If the request does not actually exist as a real file,
If the request does not actually exist as a real directory,
If the request does not happen to be for the favicon,
Then take everything up to but not including .html
and append it to index.php?seo_path=

There is a common problem when having your store in a sub-folder. If so, then another rewrite directive is necessary: rewritebase name_of_directory (Need to check on the syntax of that.)

Too Many Redirects may be coming from a problem with .htaccess directives that attempt to switch domain.com to www.domain.com, or switch to https:// and interfering with CubeCart's wanting to switch to http:// or https:// as CubeCart deems necessary.

The querystring part (after the ?) of the search URL is fine.

Link to comment
Share on other sites

Hello bsmither, thanks for the reply. At this point I'm only checking CC out and I must say I'm loving it. I have this hosted on a local dev virtual host server and have set apache up to server the site from a directory on the HD and am using a made up domain name as the ServerName which isn't using www. and I've also added a ServerAlias with www. 

Then I'm just set up my local hosts file to catch this url in my browser. So in short sounds like this is going to be the issue. But if you do find the right syntax for the rewritebase name_of_directory that would be a great help :)

Link to comment
Share on other sites

If your Apache vhosts.conf file recognizes a domain name and points to the specific server directory for the application, then technically, the application is not located in a sub-directory.

Put a "Hello World!" index.html file in CubeCart's folder and have your browser request that. If you still get Too Many Redirects, then the problem is not with CubeCart.

On the other hand, I am overlooking something: your original post says you only have a problem with Search. Let me think about that.

Link to comment
Share on other sites

I looked through PHP .ini file settings to see if there might be something there that automatically cleans up htmlentities. I didn't find one.

I now wonder if the latest GIT clone (as opposed to the package from CubeCart's main download page) has a problem.

Link to comment
Share on other sites

bsmither, you are a life saver :) After checking my php.ini all looked good to me so went with your other option of installing the old-school zip way.

And that's it all fixed and working 100%, so as you have mentioned there looks to be a bug somewhere in the git repos version and as I'm still only a day into looking around the codebase god know where this could be. If your ever over in Ireland, I'll get you a bear :) :):) Thanks so much, only hope I'll be able to help you with something in the future when I get my head round the system a bit.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...