udk1
asked on
Redirect to catagorie in case of 404
Hello,
our webshop is for hand crafted beads: each one is a unique item. Often this beads are found in google image search - nice, but when the item is sold this leads to a 404...
Is it possible to redirect to the folder/categorie containing similar products?
Example:
htttp://myServer.com/shop/ categorie1 /product99 .html -> htttp://myServer.com/shop/ categorie1 /
Thank you for help!
udk
our webshop is for hand crafted beads: each one is a unique item. Often this beads are found in google image search - nice, but when the item is sold this leads to a 404...
Is it possible to redirect to the folder/categorie containing similar products?
Example:
htttp://myServer.com/shop/
Thank you for help!
udk
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I don't use .htaccess files, as they make a site difficult to support. When there are .htaccess files scattered all over it's difficult to tell what is causing a problem. imo, better to write a very specific rule that applies only to one folder and put the rule in httpd.conf.
ASKER
Althought it is not working for me the solution is a great hint how to use Rewrite...
ASKER
Sorry, for not responding a while...
Your suggestion looks good. To bring it to my server I would like to ask some questions for deeper understanding - sorry, productive system... ;-)
It has to be inserted into the .htaccess ...
! negates a comparison result.
-s checks whether it is a file with size greater 0, -l symbolic link and -d directory. Ok?
All three conditons have to be true to come to the fourth comparison...
I found I already have .htaccess file with rules inside :-(
This contained rule for me seems relevant for the things I wanded to do:
Although I do not understand it complete it seems the way I expected to solve my problem will not work?
Open in new window
Hm, it seems the path of a product it's categories, subcategories and html-files is generated by request with PHP-code of the shop software.
So my question was wrong - my 404 page is not the "There are no search results. Would you like to search again?" - page...
This is the page the shop software is returning...
Can you suggest a solution for that? As I understand the shop software has to be adapted, or is there another way?