havenswift-hosting Posted January 28, 2017 Share Posted January 28, 2017 3 hours ago, bsmither said: Until I learn more about what I posted above, try this style @bsmither You should not mix ReWriteRule and ReDirect together as most of the time they don't work well together (strangely they sometimes do) so for CubeCart sites we always use ReWriteRule in the format you showed. @Shari Marie The 500 error you received was due to incorrectly editing the .htaccess and either deleting or adding something that shouldn't been there - it is very unforgiving of any tiny mistake. It is 100% worth the effort of adding every single old style URL that is either embedded on any other site or is already indexed by Google (try the following search in Google but without the quotes "site:sharimariecreations.com" and see what it returns !). Benefits include retaining Google link juice (which is very important for rankings) and user experience (you don't want people ever seeing the 404 if it can be helped). Ian Quote Link to comment Share on other sites More sharing options...
Shari Marie Posted January 28, 2017 Author Share Posted January 28, 2017 13 hours ago, havenswift-hosting said: The 500 error you received was due to incorrectly editing the .htaccess and either deleting or adding something that shouldn't been there - it is very unforgiving of any tiny mistake. It is 100% worth the effort of adding every single old style URL that is either embedded on any other site or is already indexed by Google (try the following search in Google but without the quotes "site:sharimariecreations.com" and see what it returns !). Benefits include retaining Google link juice (which is very important for rankings) and user experience (you don't want people ever seeing the 404 if it can be helped). I agree, I don't want them seeing the 404 so I did edit the content wording to mimic what my home page reads. I still do want to rewrite as you and Bsmithers suggested. I guess I will give it another go. Just to be clear , you said the 500 was due to my personal error. I do not want to give up . I want to proceed, but SAFELY so if I create a empty space by spacing a few lines in the area where I would be rewriting to so that i can clearly see what I am pasting in, the spacing will not create an issue will it? I did google site:sharimariecreations.com as well and wow, tons of links to my site, new and old. The only ones that do not seem to direct to my cc 404 page is the links that have page__.php. I guess I will ask the server host about that. Quote Link to comment Share on other sites More sharing options...
bsmither Posted January 28, 2017 Share Posted January 28, 2017 "the spacing will not create an issue will it?" The spaces are what delimit the parts of the directive, and the number of spaces between each part does not (should not) matter. Do not have spaces other than where shown: Command Pattern Replace [Flags] RewriteRule ^page89\.html$ whatever [NC,R=301,L] Blank lines between lines of directives also do not matter. Quote Link to comment Share on other sites More sharing options...
Shari Marie Posted January 29, 2017 Author Share Posted January 29, 2017 Thanks, I just meant the line spacing, I wont change spacing in the command itself. That 500 scared the dickens out of me but ill give it another shot with line spaces so I can clearly see what I am pasting in. Tell me if this is wrong or right. As I am rewriting, I have been going to the product online, (meaning not in the cpanel). If when I am viewing the actual product page for that item, the address bar shows the /catagory/sub catagory/product.html do I also include the sub catagories in the rewrite? or just the product itself as you indicated below. RewriteRule ^page89\.html$ http://sharimariecreations.com/hen-house-collection.html [NC,R=30] OR for example for my Bug Jar Collection that has a sub category, found at http://sharimariecreations.com/best-sellers/bug-jar-collection.html RewriteRule ^page35\.html$ http://sharimariecreations.com/best-sellers/bug-jar-collection.html [NC,R=30] Could have adding that sub category caused the 500 disaster last night? Quote Link to comment Share on other sites More sharing options...
bsmither Posted January 29, 2017 Share Posted January 29, 2017 First, it is [NC,R=301,L]. What I see above is incomplete. Second, the URL you are wanting to use in these directives is no more and no less than exactly what CubeCart shows you in the address bar. The URL in the address bar (up to and including the .html) is the only and exact thing that CubeCart has in its database to find the proper product to show. So, if CubeCart has:www.domain.com/top-category/sub-category/sub-category/sub-category/product-name.html that is what you need to be using in the .htaccess RewriteRules. Quote Link to comment Share on other sites More sharing options...
Shari Marie Posted January 29, 2017 Author Share Posted January 29, 2017 yes, my example left off the ,L I have it correct in the cpanel htaccess. oversite when I copied and pasted it here. Thank you. I wondered why some products in sub categorys do not show the sub categories in the address bar. like this one, http://sharimariecreations.com/paper-doll-collection.html (Paper Dolls Product) Others are showing the subcategory but not the product name like this one. Seems odd to me. http://sharimariecreations.com/design-collections/children-s-collections/.html (Furry Friends Product) BOTH are in the Children's category. Just courious. I have gotten both re directed successfully by closely adhering to your instructions about using exactly what is in the address bar, but still, made me courious. As always, thanks again. Quote Link to comment Share on other sites More sharing options...
bsmither Posted January 29, 2017 Share Posted January 29, 2017 In admin, Editing a product, Search Engines tab, there will be an SEO Path text entry field. What you see in here is the ONLY thing that CubeCart will use to figure which product to show. True, you can also get to a product using any of the "secondary" categories the product would be assigned to. The path to the secondary category will show in the Breadcrumbs. Only the Breadcrumbs. But, what you find in the SEO Path text entry field is what you must use (with the domain name and .html parts added). Otherwise, CubeCart won't know what product to show. And, CubeCart will show that path as the URL in the web browser address bar. You said, "what's in the address bar.........that changes depending upon which category the customer is looking at the product under." If you are looking at a List of Products having navigated to a Category, then you are looking a Category Listing. The browser address bar shows the SEO Path of that category. But if you are looking at a specific product, then the browser address bar will show the SEO Path of that product. But, if it truly is the case that when viewing a specific product, the address bar shows a different SEO Path depending how one navigated there (probably as depicted in the breadcrumbs), then you probably have two products, identical in every way, except each having a different category assigned as it's primary category, Best Seller vs something else (and very likely a different SEO Path). Quote Link to comment Share on other sites More sharing options...
Shari Marie Posted January 29, 2017 Author Share Posted January 29, 2017 Ok, I will stick to the SEO address and leave it at that. I have been able to redirect/rewrite many of my products thus far and will continue to do so as I add more products. So on that note, I think I am good where it comes to this. The only exception has been of the old pages that had page_.php extentions that created the fatal error page. I would love to be able to resolve those. Should I begin a new topic for this? I suspect that those php pages were connected to the old Instant Download Cart (the folder was called idc in my cpanel) had everything to do with it, I knew I was not going to use the idc as it was no longer working out so I deleted the idc file. I don't know how to proceed with eliminating those fatal error links. Anything with the php extention seems to be giving that fatal result. I think for those products I did not have a html page, at all, just the idc cart page that created those page_.php pages that are no longer working. The reason for doing that was I had a page limit with my hosting package and I found that was a way to get around to add additional products. Anyway, Example: http://sharimariecreations.com/page95.php Warning: require_once(init.php): failed to open stream: No such file or directory in /home1/sharimw/public_html/page95.php on line 2Fatal error: require_once(): Failed opening required 'init.php' (include_path='.:/opt/php56/lib/php') in /home1/sharimw/public_html/page95.php on line 2 Quote Link to comment Share on other sites More sharing options...
bsmither Posted January 29, 2017 Share Posted January 29, 2017 This file: /public_html/page95.php, and every file like it should be deleted from Cubecart's folder. Quote Link to comment Share on other sites More sharing options...
Shari Marie Posted January 29, 2017 Author Share Posted January 29, 2017 Ok, I will delete all of the similar php page files. What about the two files I circled below them? do i delete those as well?low Quote Link to comment Share on other sites More sharing options...
bsmither Posted January 29, 2017 Share Posted January 29, 2017 You can delete those circled items as well (they are very old). I believe "server.php" can also be deleted as it is not used by CubeCart. Quote Link to comment Share on other sites More sharing options...
Shari Marie Posted January 29, 2017 Author Share Posted January 29, 2017 I am still in the process of deleting these php's . I clicked on a link I had for one of them that i found on Pinterest and I am directed to the Host Gator 404 page. Is that what was expected to happen? Quote Link to comment Share on other sites More sharing options...
bsmither Posted January 29, 2017 Share Posted January 29, 2017 The .htaccess file has a directive for what the web server is suppose to do if a file cannot be found. I am surprised that the web server responded with the default 404 document. So, in the .htaccess file, at the bottom, there should be: ### Default store 404 page ### ErrorDocument 404 /index.php ## Override default 404 error document for missing page resources ## <FilesMatch "\.(gif|jpe?g|png|ico|css|js|svg)$"> ErrorDocument 404 "<html></html> </FilesMatch> ##### END CubeCart .htaccess ##### Please verify that these directives are present. Quote Link to comment Share on other sites More sharing options...
Shari Marie Posted January 29, 2017 Author Share Posted January 29, 2017 Here's what I've got. RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !=/favicon.ico RewriteRule ^(.*)\.html?$ index.php?seo_path=$1 [L,QSA] </IfModule> # Override default 404 error document for missing page resources ## <FilesMatch "\.(gif|jpe?g|png|ico|css|js|svg)$"> ErrorDocument 404 "<html></html> </FilesMatch> ##### END CubeCart .htaccess ##### RewriteCond %{HTTP_HOST} ^sharimariecreations\.com$ [OR] RewriteCond %{HTTP_HOST} ^www\.sharimariecreations\.com$ RewriteRule ^idc\/index\.php$ "http\:\/\/sharimariecreations\.com\/" [R=301,L] Quote Link to comment Share on other sites More sharing options...
bsmither Posted January 29, 2017 Share Posted January 29, 2017 Near the top, there should be these directives: ### Rewrite rules for SEO functionality ### <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / Add the following to just after them: RewriteCond %{HTTP_HOST} ^www\.sharimariecreations\.com$ RewriteRule ^(.*)$ http://sharimariecreations.com/$1 [R=301,L] Delete the three lines you have at the very end (those directives after "End CubeCart .htaccess"). That's the wrong place for those directives. Then, near the bottom, there are two lines missing. Add the missing lines: </IfModule> ### Default store 404 page ### ErrorDocument 404 /index.php ## Override default 404 error document for missing page resources ## Quote Link to comment Share on other sites More sharing options...
Shari Marie Posted January 29, 2017 Author Share Posted January 29, 2017 3 minutes ago, bsmither said: Near the top, there should be these directives: ### Rewrite rules for SEO functionality ### <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / Add the following to just after them: RewriteCond %{HTTP_HOST} ^www\.sharimariecreations\.com$ RewriteRule ^(.*)$ http://sharimariecreations.com/$1 [R=301,L] Delete the three lines you have at the very end (those directives after "End CubeCart .htaccess"). That's the wrong place for those directives. Then, near the bottom, there are two lines missing. Add the missing lines: </IfModule> ### Default store 404 page ### ErrorDocument 404 /index.php ## Override default 404 error document for missing page resources ## In that first edit, do I put that coding before the rewrites that I have been doing this afternoon or after them? Quote Link to comment Share on other sites More sharing options...
bsmither Posted January 29, 2017 Share Posted January 29, 2017 Let's put them after the page##.html directives. The page##.html directives already bounce to the correct URL. Let's let that happen if it needs to happen, then, if there isn't a match on a page##.html, but there is a request being made to www.sharimariecreations.com, then we can bounce that to the correct URL. Quote Link to comment Share on other sites More sharing options...
Shari Marie Posted January 29, 2017 Author Share Posted January 29, 2017 Well, I went ahead and did what I thought you meant, and put it before the page##html directives. It seems to have worked. The link I had tried earlier on Pinterest, now take me to my CC404 page, (that I edited to read like a quasi home page, in actuality the 404) That's much better than HostGators 404 page. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.