Jump to content

Redirect broken links using htaccess file in CC6.0.7


All Things Vintage
 Share

Recommended Posts

Thanks for any Help in advance.
First off, the server my site is on is an apache and it has an htaccess editor,I've used to try and redirect 46 broken links I've changed with
the new cc6.0.7 upgrade.
All the rewrite data is in place in the htaccess file that cubecart automatically places when built.
I have around a 130 websites on this server for the past 10 years or more so I've been with them for quit some time.
When I used the hatches editor for url redirect I've noticed the urls go into the public htaccess file and not the cubecart htaccess file.Ive manually placed them in the cubecart htacess and remove the 301 redirects from the public file.The company I use service from swears its not on their end and that it has to be a cubecart issue , been fighting them for 3 days off and on.here is an example what happens to the redirect 301 urls when in action....this is what shows up in the browser address bar.
I need this url http://www.vintageindian.com/stickers.html to change to this http://www.vintageindian.com/patches/stickers.htmlbut it is returning in the browser address bar as this: http://www.vintageindian.com/patches/stickers.html?seo_path=stickers and it still shows up as
a 404 page not found...I'm stumped if anyone can guide me through this.
The techs with the company who operate the server claims the are two items fighting with each other in cubecar one is the friendly url /and conical url as though both are running together?
Im not sure ive tried everything I could think of to fix...I still think its on the server side...maybe not?


Thanks
All Things Vintage

 

Link to comment
Share on other sites

If you are using cPanel and using the redirect functionality then that will only ever add directives to the .htaccess file in the public_html directory

If you have your own dedicated server or reseller account and have been with them for ten years then I would expect them to offer more help than they seem to be doing. CubeCart does do it's own redirects but they arent anything special and even if they dont know  the software then they should be able to easily figure it out if they are interested in supporting you as a client !

When looking at that url I am seeing the same redirect to a 404 page - you might want to try clearing all SEO custom urls.  Your hosting support people may be correct but if they dont know (and dont care) about CubeCart then they may not be willing to spend the time to find and fix the cause

Ian 

Link to comment
Share on other sites

"/patches/stickers.html?seo_path=stickers"

The first bounce is a 301, maybe from an htaccess rule? If so, is this rule before or after the rule that rewrites the URL by adding seo_path=whatever as a new part of the querystring?

By keeping the seo_path part of the querystring for the 302 bounce, CubeCart is obliged to use that value ('stickers') instead of a duplicate of what may be appended afterwards, such as seo_path=patches/stickers.

If all this is as described, CubeCart will give a 404 because it was obliged to use 'stickers'.

Link to comment
Share on other sites

  • 2 weeks later...

Hi Brian et al. 

I have changed my site over from http://... to https://www.harrisorganicwine.com.au

I see there are a few parts to this.

1. changing code in htaccess to the root domain

2. reviewing htaccess to CC6 shop with START v4 SEO URL BACKWARD COMPATIBILITY .. cant see anything to change

3. Turn on or OFF SSL in CC store settings - does not seem to make any difference whether on or off.

4. Test the site by changing the URl, two options removing www and using http, without 's"

All seems to work fine, until I found out old links to the site dont have either www or https in the url. Therefore when I make some changes to the root htaccess file a few things happen.

This is only part of the file below:

RewriteEngine on

RewriteCond %{HTTPS} off   # Using this one stops /404 errors and adds index.php?seo_path= to the URL.
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]

RewriteCond %{SERVER_PORT} 80  # redirect for global SSL
RewriteRule ^(.*)$ https://www.harrisorganicwine.com.au/$1 [R=301,L]

When I add RewriteCond %{HTTPS} off etc  it  stopped the site giving 404 errors and adds index.php?seo_path=  to the url when I test it by removing the s in https

eg.

http://www.harrisorganicwine.com.au/shop/dry-whites/chilli-white.html  becomes

https://www.harrisorganicwine.com.au/shop/index.php?seo_path=dry-whites/chilli-white

and when I remove the www.

https://harrisorganicwine.com.au/shop/dry-whites/chilli-white.html

https://harrisorganicwine.com.au/shop/dry-whites/chilli-white.html no change,

however if I add a wildcard redirect through the hosting panel ie, from

http://harrisorganicwine.com.au to http://www.harrisorganicwine.com.au all I get is a 404 error.

Any thoughts how to fix these issues as I have little experience in htaccess code.

Duncan

 

Link to comment
Share on other sites

"I have changed my site over from http:... to https:..."

CubeCart can manage this quite well all on its own.

I have seen some complications if the SSL Certificate is "shared".

I have no advice concerning what may be sitting at the root of your hosting space, but CubeCart at /shop/ doesn't care whether one arrives at the site using www or not. (There is some consternation if using 'localhost' or a computer's name that can be resolved on a LAN, or by an IP address.)

Link to comment
Share on other sites

Please elaborate on what you want the end result to be.

The browser is given a URL such as: example.com/store/cat/prod.html

Skipping over what you think is necessary in the .htaccess file, what do you want the visitor to see in the address bar of the browser?

Link to comment
Share on other sites

Hi Brian, 

If your browser is giving a URL such as : example.com/store/cat/prod.html  thats OK.

then if it is an https secure site the url will be https://example.com/store/cat/prod.html

However if you have external links with http://example.com/store/cat/prod.html   (ie. no s in http) the resultant url for the customer will be something like https://example.com/store/index.php?seo_path=cat/prod.html

I would want the end result to be https://example.com/store/cat/prod.html

regards Duncan

 

 

Link to comment
Share on other sites

I'm not having any problem with a pristine installation in a sub-directory off of a blog platform:
example.com/shop/cat/prod.html (assumes http://)
successfully bounces to:
https;//www.example.com/store/cat/prod.html

There is nothing strange in the .htaccess file or httpd.conf file. I do not receive a 404 like you say you had with http;//www.

 

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.

Guest
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.

 Share

×
×
  • Create New...