giulmas Posted June 5, 2015 Share Posted June 5, 2015 Hi everyone. I'm filling out the .htaccess of landisport.com with the redirect 301 rule. If I try to insert this incorrect url: Redirect 301 /images/2012/maschere smith 2012/SMITH Stance REG Goggle 201 http://www.landisport.com/ (this is the link found in webmaster tools), the system returns to me an Internal Server Error... Anyone one could explain me why? Is it because of that link uncomplete? Unfortunately it's exactly the url found on webmaster tools... :( I've tried also to fill the blank space between the words of the link with "%20": in this case, the website doesn't return a 404 error, but the link remains "Not found" even after the Redirect 301.... :( Redirect 301 /images/2012/caschi%20smith/SMITH%20Holt%20Helmet%202012%20matte%20white http://www.landisport.com Any help will be appreciated, thanks in advance G. Link to comment Share on other sites More sharing options...
Hotclutch Posted June 5, 2015 Share Posted June 5, 2015 Be very careful with redirects, especially htaccess rules which are complicated. You can do more harm than good sometimes if the rules are not written right. Link to comment Share on other sites More sharing options...
♥raiwa Posted June 5, 2015 Share Posted June 5, 2015 @@giulmas, if you are trying to show a file you may need to add the file extension. For example ".jpg" if its an image. About Me: http://www.oscommerce.com/forums/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Link to comment Share on other sites More sharing options...
giulmas Posted June 5, 2015 Author Share Posted June 5, 2015 @@giulmas, if you are trying to show a file you may need to add the file extension. For example ".jpg" if its an image. Sure, thanks! I'm trying to obtain something good from the big mess that I've inherited by previous webmaster... :( it's a very hard work indeed! So I have to give up? Isn't there anything I can do to correct these 404 errors? thanks Link to comment Share on other sites More sharing options...
Hotclutch Posted June 5, 2015 Share Posted June 5, 2015 Looks like there's something wrong with your URLs, or you have rules on top of rules, in your htaccess perhaps eg. http://www.landisport.com/-c-24.html I am sure it's not supposed to read like that. Link to comment Share on other sites More sharing options...
giulmas Posted June 5, 2015 Author Share Posted June 5, 2015 It would be like that: http://www.landisport.com/catalogo/snowboard.html Any chance to get this output? To paste here the htaccess file would help? thanks in advance G. Link to comment Share on other sites More sharing options...
Hotclutch Posted June 5, 2015 Share Posted June 5, 2015 Should be snowboard-c-24 Impossible to say where the problem might be with templates, unless you know the template first hand. Link to comment Share on other sites More sharing options...
giulmas Posted June 6, 2015 Author Share Posted June 6, 2015 :( The .htaccess file, by the way, is at the moment: RewriteRule ^(.*)-p-(.*).html$ product_info.php?products_id=$2&%{QUERY_STRING} RewriteRule ^(.*)-c-(.*).html$ index.php?cPath=$2&%{QUERY_STRING} RewriteRule ^(.*)-m-(.*).html$ index.php?manufacturers_id=$2&%{QUERY_STRING} RewriteRule ^(.*)-pi-(.*).html$ popup_image.php?pID=$2&%{QUERY_STRING} RewriteRule ^(.*)-by-(.*).html$ all-products.php?fl=$2&%{QUERY_STRING} RewriteRule ^(.*)-t-(.*).html$ articles.php?tPath=$2&%{QUERY_STRING} RewriteRule ^(.*)-a-(.*).html$ article_info.php?articles_id=$2&%{QUERY_STRING} RewriteRule ^(.*)-au-(.*).html$ articles.php?authors_id=$2&%{QUERY_STRING} RewriteRule ^(.*)-pr-(.*).html$ product_reviews.php?products_id=$2&%{QUERY_STRING} RewriteRule ^(.*)-pri-(.*).html$ product_reviews_info.php?products_id=$2&%{QUERY_STRING} RewriteRule ^(.*)-f-(.*).html$ faqdesk_info.php?faqdesk_id=$2&%{QUERY_STRING} RewriteRule ^(.*)-fc-(.*).html$ faqdesk_index.php?faqPath=$2&%{QUERY_STRING} RewriteRule ^(.*)-fri-(.*).html$ faqdesk_reviews_info.php?faqdesk_id=$2&%{QUERY_STRING} RewriteRule ^(.*)-fra-(.*).html$ faqdesk_reviews_article.php?faqdesk_id=$2&%{QUERY_STRING} RewriteRule ^(.*)-i-(.*).html$ information.php?info_id=$2&%{QUERY_STRING} RewriteRule ^(.*)-links-(.*).html$ links.php?lPath=$2&%{QUERY_STRING} RewriteRule ^(.*)-pm-([0-9]+).html$ info_pages.php?pages_id=$2&%{QUERY_STRING} RewriteRule ^(.*)-n-(.*).html$ newsdesk_info.php?newsdesk_id=$2&%{QUERY_STRING} RewriteRule ^(.*)-nc-(.*).html$ newsdesk_index.php?newsPath=$2&%{QUERY_STRING} RewriteRule ^(.*)-nri-(.*).html$ newsdesk_reviews_info.php?newsdesk_id=$2&%{QUERY_STRING} RewriteRule ^(.*)-nra-(.*).html$ newsdesk_reviews_article.php?newsdesk_id=$2&%{QUERY_STRING} RewriteRule ^(.*)-po-([0-9]+).html$ pollbooth.php?pollid=$2&%{QUERY_STRING} Link to comment Share on other sites More sharing options...
Hotclutch Posted June 6, 2015 Share Posted June 6, 2015 Well that's very different to what a normal installation looks like for osCommerce. With that template you're going to have a hard time finding support here, because few people will know what's going on. Perhaps you can consider a version of osCommerce from here, at least there will be more people to help if you run into a problem. Link to comment Share on other sites More sharing options...
giulmas Posted June 6, 2015 Author Share Posted June 6, 2015 Ok, thanks. My .htaccess is different because of Ultimate SEO... Cheers G. Link to comment Share on other sites More sharing options...
Hotclutch Posted June 6, 2015 Share Posted June 6, 2015 Ok i see, it's from this version: http://addons.oscommerce.com/info/2823 try looking through the support thread. Link to comment Share on other sites More sharing options...
Bob Terveuren Posted June 6, 2015 Share Posted June 6, 2015 Hey there Make sure your 301 redirect code comes after a RewriteEngine on and bung it in there before the SEO URLS stuff... To change all images (like you have moved a folder) rewritecond %{REQUEST_URI} ^.*/jpgs/(.*)$ [nc]rewritecond %{REQUEST_URI} !^.*/images/jpgs/(.*)$ [nc]rewriterule ^(.*)/jpgs/(.*)$ http://www.mysite.com/images/jpgs/$1/$2 [r=301,nc] To redirect individual images then you'll need the filenames and set it up indiviually Depending on your server this may create more problems - they are all different and .htaccess can vary in operation depending on the server setup and what Apache mods are running... Link to comment Share on other sites More sharing options...
MrPhil Posted June 6, 2015 Share Posted June 6, 2015 If you have blanks (spaces) within a URL, did you ever try wrapping it in " (quotation marks)? That might work better than %20, which might not be recognized at this point in the processing. Link to comment Share on other sites More sharing options...
giulmas Posted June 7, 2015 Author Share Posted June 7, 2015 ...I wonder if isn't possible to output the breadcrumb path in the url... Something like that: from http://www.landisport.com/snowboard-c-24_29.html to http://www.landisport.com/snowboard-scarponi.html thanks Link to comment Share on other sites More sharing options...
giulmas Posted June 7, 2015 Author Share Posted June 7, 2015 If you have blanks (spaces) within a URL, did you ever try wrapping it in " (quotation marks)? That might work better than %20, which might not be recognized at this point in the processing. Thanks for answer! Link to comment Share on other sites More sharing options...
giulmas Posted June 7, 2015 Author Share Posted June 7, 2015 Hey there Make sure your 301 redirect code comes after a RewriteEngine on and bung it in there before the SEO URLS stuff... To change all images (like you have moved a folder) rewritecond %{REQUEST_URI} ^.*/jpgs/(.*)$ [nc] rewritecond %{REQUEST_URI} !^.*/images/jpgs/(.*)$ [nc] rewriterule ^(.*)/jpgs/(.*)$ http://www.mysite.com/images/jpgs/$1/$2 [r=301,nc] To redirect individual images then you'll need the filenames and set it up indiviually Depending on your server this may create more problems - they are all different and .htaccess can vary in operation depending on the server setup and what Apache mods are running... Thanks for answer! Link to comment Share on other sites More sharing options...
giulmas Posted June 8, 2015 Author Share Posted June 8, 2015 ...I wonder if isn't possible to output the breadcrumb path in the url... Something like that: from http://www.landisport.com/snowboard-c-24_29.html to http://www.landisport.com/snowboard-scarponi.html thanks ...any suggestion? thanks to you all! Link to comment Share on other sites More sharing options...
MrPhil Posted June 8, 2015 Share Posted June 8, 2015 Anything's possible, but the problem is that you would have to write code (or have something in the database) to map "snowboard-scarponi" to the dynamic URI giving the category and/or product number. The way it is now, that information is already in the URI and all you have to do is reformat it, stripping out the natural language text and just giving the query string with the appropriate IDs. So yes, it could be done, but is it worth the bother? Link to comment Share on other sites More sharing options...
giulmas Posted June 9, 2015 Author Share Posted June 9, 2015 I think yes... Link to comment Share on other sites More sharing options...
MrPhil Posted June 9, 2015 Share Posted June 9, 2015 Well, I suppose you could add to your .htaccess some rewrite rules like RewriteRule ^snowboard-scarponi\.html$ /index.php?catID=24_29%{QUERY_STRING} which could become quite a burden if you have lots of these special cases. I'm not sure you could wait until it's in PHP code (and do a database lookup) without risking a 404 error. You might be able to check for !-F and !-D and send the URI as a Query String to a special decoder.php which would redirect to the right place (after a database lookup), but that could be quite ugly. If your concern is that the -c-24_29 itself is disfiguring to the URI, another possibility would be to "hide" it at a lower level: /c-24_29/snowboard_scarponi.html which would require modification of the SEO code and the .htaccess to reassemble it to the right dynamic URI: /index.php?catID=24_29 or whatever (the descriptive text "snowboard_scarponi" is simply discarded). You still can't get rid of the c-24_29 without a lot of extra work. Link to comment Share on other sites More sharing options...
giulmas Posted June 10, 2015 Author Share Posted June 10, 2015 Thanks for your help! Much appreciated Cheers G. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.