Using Reg Ex to 301 old categories and query strings in Magento
-
Hi SEOmoz community!
I'm hoping somebody with a little Magento and Reg Ex knowledge will be able to help me out here.
I need to 301 some old categories along with their old query strings. Below is an example.
Old URL
/bed-linen/pillowcases-html.html
Users can then filter by price or range which then creates a query string such as...
/bed-linen/pillowcases-html.html?price=1%2C10
New URL:
/bed-linen/pillowcases.html
So the new query string will be
/bed-linen/pillowcases.html?price=1%2C10
Does anybody know the Reg Ex to 301 this? Can this be done in Magento re-write module or by htaccess only?
Thanks in advance
Anthony
@Anthony_Mac85
-
Thanks for taking the time to answer.
Yeh I mean regular expression, it's apache mod-rewrite and we use .htaccess
I'm struggling to figure out to 301 old url query strings to the new ones. There are several possible query strings for each product category so would take forever to do them one by one in magento re-write. The query strings will be the same i.e. ?price=1%2C10 but the category url will be different as you can see in my example above.
any ideas or do I need to hire an expert?
Thanks
-
I'd suggest checking with your host. I'm not sure if your reference to reg ex means "reg ex" in the sense of it being reforwarding software, or in the sense of using regular expressions to type syntax to handle it.
most hosts will have reforwarding software of some sort installed with their user accounts (the 301 thing is pretty common). once they let you know what it is (for example it might be apache's mod-rewrite or isapirewrite.com), you can figure out the format you need to write the rewrite commands in. some of them use IIS, some of them use .htacess, it all just depends.
if your old url and new urls are in respective "structures" you may also be able to put in wildcards to handle the directory words all at once.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Category pages
I am a very basic question on managing categories in WordPress. We have an Android website, and we cover news, rumors, tips and tricks about new devices. We have been creating categories for the new devices or at least for the popular ones which are launched every year, and link to them internally with the hope that it would improve the page authority and ranking. For example, we have a category page for Moto X, another one for Moto X (2014) and one more for Moto X (2015). One of the reasons for creating a category was to ensure that it is easier for readers to get information about a particular device rather than going to a category page that has information about all the models. However, the problem with their strategy we're now realizing is that it means we have to build page authority for the new category page from scratch, which can take time. So we are thinking of reusing the same category for multiple models. So reuse the Moto X category page for Moto X (2016). However, we are not sure if it would be right approach as we would be linking to the same category page with different anchor texts. So while it would be good to reuse a page rather than rebuild the page authority from scratch, would we be diluting the authority for the main keyword by using it for different models. I would love to hear your thoughts on how we should be handling categories and internal links in this case.
Intermediate & Advanced SEO | | Gautam0 -
Ecommerce catalog update: 301 redirects?
Hello mozers, We run an ecommerce store and are planning a massive catalog update this month. Essentially, 100% of our product listings will be deleted, and an all new catalog will be uploaded. The new catalog contains mostly new products, however there are some products that already existing in the old catalog as well. The new catalog has a bunch of improvements to the product pages, included optimized meta titles and descriptions, multiple language, optimized URLs and more. My question is the following: When we delete the existing catalog, all indexed URLs will return 404 errors. Setting up 301 redirects from old to new products (for products which existing previously) is not feasible given the number of products. Also, many products are simply being remove entirely. So should we go ahead and delete all products, upload the new catalog, update the sitemap, resubmit it for crawling, and live with a bunch of 404 errors until these URLs get dropped from Google? The alternative I see is setting 301 redirects to the home page, but I am not sure this would be correct use of 301 redirects. Thanks for your input.
Intermediate & Advanced SEO | | yacpro130 -
My blog is indexing only the archive and category pages
Hi there MOZ community. I am new to the QandA and have a question. I have a blog Its been live for months - but I can not get the posts to rank in the serps. Oddly only the categories rank. The posts are crawled it seems - but seen as less important for a reason I don't understand. Can anyone here help with this? See here for what i mean. I have had several wp sites rank well in the serps - and the posts do much better. Than the categories or archives - super odd. Thanks to all for help!
Intermediate & Advanced SEO | | walletapp0 -
301 issues
Hi, I have this site: www.berenjifamilylaw.com. We did a 301 from the old site: www.bestfamilylawattorney.com to the one above. It's been several weeks now and Google has indexed the new site, but still pulls the old one on search terms like: Los Angeles divorce lawyer. I'm curious, does anyone have experience with this? How long does it take for Google to remove the old site and start serving the new one as a search result? Any ideas or tips would be appreciated. Thanks.
Intermediate & Advanced SEO | | mrodriguez14400 -
Massive URL Migration with thousands of 301
Hey Everyone! I'm currently working on a project that we have A Lot of product pages and we have thousands of URL's that need to be 301'd over. I know this can be a major issue and could lead to tons of errors. What is everyone's thought of doing such a huge Migration, Should I do it all in phases? or should I do them all at once so they can all be indexed together? What would you suggest to be the best way to go about doing such a massive migration?
Intermediate & Advanced SEO | | rpaiva0 -
Keep Pages with Old Dates?
We have a tourism related site. We list annual events. Right now the URL extension includes the year. I assume it is better to keep the same page and update the dates, thereby keeping any links, ranking trust and authority we built. Is that the best strategy by updating the event info with the new dates? I would assume with a new page for the new year we would be starting over again and would have too much similar content and link diffusion. And in the future are we better off not including the year in the URL extension?
Intermediate & Advanced SEO | | Ebtec0 -
301 Redirect Dilemma - Website redesign
Hi Guys, We are redesigning a clients ecommerce site. As part of the process, we're changing the URL structure to make it more friendly. I have put together a provisional 301 redirect plan but I'm not sure just how far I need to go with it. So far I have extract all the pages from the existing site that Google Webmaster Tools says have links pointing at them - this totals 93 pages. I have matched each page like for like to the new website structure. My next step was to pull the landing pages report from Google Analytics, I have extracted the pages that received entrances over the last 6 weeks. This totals 553, less the redirects I have already done and cleaning up some Google Translate pages I have circa 410 pages left. Many of these pages has more than 1 URL pointing to that page. I'm debating how important it is that that all of these remaining 410 pages have individual redirects set up for them one by one. I have to rule out regex because there is no pattern that makes sense given that I have already set up redirects for the first 93 pages that have external links. My question therefore is how important are 301 redirects on pages that have no external links and receive less than 10 entrances over a 6 week previous period? Do I need to 301 every single product on the old site to it's corresponding page on the new site? Also, I'm not sure how to treat pages that have mutliple URL's on the old site, the existing URL structure is such a mess that in some instances I have 5 URL's for one product page? I could feasibly create 5 seperate redirects but is this necessary? Also what about speed considerations, the server is going to have to load these redirects and it may slow the site down. I'm sitting at 100 odd so far. Any answers are most appreciated. Thanks Derek.
Intermediate & Advanced SEO | | pulseo0 -
SEO vs 301
I have a website about "Download of games" and im planning open one about "games online" i know that "games online" its super hard to get good ranks, soo im thinking and do a 301 from my website of "download games" to my new website, do you think that is a good strategy ?
Intermediate & Advanced SEO | | nafera21