I have just done the unthinkable of changing my urls around so instead of being downloads/$category/$item_id/ it is now /$category/$item_name/ so I suppose I need a regex which will take the category variable and 301 it to the new location, and if the item id is available then 301 it to the category since the item id can't be translated to item name. So I'm thinking I probably need two rules So it's something like this to do the redirect for categories RewriteRule ^/downloads/(.*)/$ /$1/ [R=301,L] and this for item id's RewriteRule ^/downloads/(.*)/([0-9]+)/$ /$1/ [R=301,L] this is my first rewrite rule though, so I'd rather have it checked then just put it to use and have it fail. Also is it possible to take a part of the url and make it upper case? Say the category name?
I gues you will need to wait for Nintendo to answer your question, unless another DP member with good rewrite knowledge comes first.
well it should be simple enough, it's just extracting one variable from the url and then using it in the url to redirect to.
er why did you change it when it wasn't very broken!!!!!! Oh I hope you don't have pages already indexed in the search engines!!!! RewriteRule ^downloads/(.*)/(.*)$ http://www.domain.com/$1 [R=301,L]
I basically only want to get rid of downloads yeah, I know I can't redirect every single page to it's new destination, already specified that, however, I can redirect them all to their category index, which will do just fine. And it was sorta broken, /category/1231/ isn't very descriptive, the item name is far more descriptive, and only a few of the items are actually indexed so it shouldn't hurt too much. But would my regexes work for getting rid of the /downloads/ part and the /$item_id/ part?
Awesome thanks, what about extracting part of the url and making it upper case? Is .htaccess capable of that?
RewriteEngine on RewriteMap upper2lower int:tolower RewriteRule ^/(.*)$ /${upper2lower:$1} is the other way around. I'm not sure if there is a lower to upper.