to: /some-product-name (e.g. /ichiban-fairly-offensive-sweat-in-grey)
We have 1,090 products and 60+ categories so some form of .htaccess trick would be amazing to know. If anyone could provide me with what I could put in the .htaccess to accomplish this I would be eternally grateful!
Msg#: 4573135 posted 8:04 pm on May 11, 2013 (gmt 0)
I've not seen an answer for this mass 301 redirect issue specifically
Well, no, you're not going to find a thread that says how to redirect the exact URL 123-rest-of-name to the exact URL rest-of-name
But there are hundreds of posts detailing RewriteRules that will do the trick.
If you already use mod_rewrite (RewriteRule by that name, regardless of what it does) then any redirects in the same htaccess also need to use mod_rewrite.
If not, you can use mod_alias in the RedirectMatch form. You need RedirectMatch (or RewriteRule) rather than simply Redirect because you'll be setting up a simple Regular Expression and capturing part of the request.
Based on your examples, it looks as if both types of redirect can be collapsed into a single rule.
Msg#: 4573135 posted 10:00 am on May 12, 2013 (gmt 0)
I'm not able to figure out how to write the redirect expressions. Are you able to help me out massively? We are meant to be switching to our new site this evening.
And secondly, it wasn't cut short - Prestashop use the .html extension for product URLs and Opencart doesn't.
We haven't switched over yet. I'd like to have the .htaccess setup to redirect before the switch. The reason for switching is because Prestashop is poor/keeps crashing the servers/doesnt have cheap mobile framework.
So if you could help me out by writing what I'd need, I'd even be happy to send over a small donation.
Msg#: 4573135 posted 9:18 pm on May 12, 2013 (gmt 0)
Prestashop use the .html extension for product URLs and Opencart doesn't.
Oh now wait. So you're also redirecting to a different domain? In one way this makes it easier, because you don't have to keep track of rule ordering; the rewrites will happen in a completely different place. That's assuming the new domain is also on a different server, or at least in a different userspace in shared hosting, so requests for the two domains will never pass through the same htaccess.
The bad news is that WebmasterWorld doesn't write people's code for them. We're more about helping people learn how to do things for long-term benefits. You might try That Other Forum. They seem to be correct more than half the time.