Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Redirect 301: what's up?


giulmas

Recommended Posts

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

@@giulmas,

 

if you are trying to show a file you may need to add the file extension.

For example ".jpg" if its an image.

Link to comment
Share on other sites

@@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

:(  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

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

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

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

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

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...