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
-
How long will old pages stay in Google's cache index. We have a new site that is two months old but we are seeing old pages even though we used 301 redirects.
Two months ago we launched a new website (same domain) and implemented 301 re-directs for all of the pages. Two months later we are still seeing old pages in Google's cache index. So how long should I tell the client this should take for them all to be removed in search?
Intermediate & Advanced SEO | | Liamis0 -
ECommerce SEO for product categories and sub-categories
Hello everyone, We run a Magento store, and I have a general question about SEO-eCommerce. We recently launched a new site where we've modified the menu navigation for product categories. So let's say in the past we had a main category called 'Jackets' in the top navigation bar, and once you were on the jackets page you had a few subcategories to choose from. On the new site, we reworked the navigation bar in order to get our customers there in fewer clicks. So right away in the top bar, the customer can click 'Casual Jackets', 'Leather Jackets' and 'Winter Jackets'. We no longer have an internal link to the parent category 'Jackets'. Now here's the question:
Intermediate & Advanced SEO | | yacpro13
-Do I 301 redirect 'jackets' to one of the sub-categories of my choosing?
or
-Do I keep the main category 'jackets' even though we don't actually link to it internally? I see pros and cons for both, and I'd like to proceed in the way that will be most beneficial from a rnakings point of view for all jackets categories. Thanks!0 -
301 Redirecting from domain to subdomain
We're taking on a redesign of our corporate site on our main domain. We also have a number of well established, product based subdomains. There are a number of content pages that currently live on the corporate site that rank well, and bring in a great deal of traffic, though we are considering placing 301 redirects in place to point that traffic to the appropriate pages on the subdomains. If redirected correctly, can we expect the SEO value of the content pages currently living on the corporate site to transfer to the subdomains, or will we be negatively impacting our SEO by transferring this content from one domain to multiple subdomains?
Intermediate & Advanced SEO | | Chris81980 -
Manual action penalty revoked, rankings still low, if we create a new site can we use the old content?
Scenario:
Intermediate & Advanced SEO | | peteboyd
A website that we manage was hit with a manual action penalty for unnatural incoming links (site-wide). The penalty was revoked in early March and we're still not seeing any of our main keywords rank high in Google (we are found on page 10 and beyond). Our traffic metrics from March 2014 (after the penalty was revoked) - July 2014 compared to November 2013 - March 2014 was very similar. Question: Since the website was hit with a manual action penalty for unnatural links, is the content affected as well? If we were to take the current website and move it to a new domain name (without 301 redirecting the old pages), would Google see it as a brand new website? We think it would be best to use brand new content but the financial costs associated are a large factor in the decision. It would be preferred to reuse the old content but has it already been tarnished?0 -
We're currently not using schemas on our website. How important is it? And are websites across the globe using it?
Schemas looks like an important thing when it comes to structuring your website and ensuring the crawl bots get all the details. I've been reading a lot of articles around the web and most of them are saying that schemas are important but very few websites are using it. Why so? Are the schemas on schema.org there to stay or am I wasting my time?
Intermediate & Advanced SEO | | Shreyans920 -
Drupal Alinks is this good to use?
Hi, https://drupal.org/project/alinks We have 1,000's of Soft links created like this in 1,000's of pages Each page 1 to 2 links that are soft links would this be fine? SEO would this be good or should we remove it Thanks
Intermediate & Advanced SEO | | mtthompsons0 -
301 redirect a old site that has been "dead" for a while?
Hi guys, A quick question. I have a client who has an old business website that had some great links (Forbes.com, CocaCola.com, etc). The problem is that he knew nothing about SEO and let the hosting expire. He still owns the domain, but the site is no longer listed in Google. He did no SEO, so I am not worried about being hit by any artificial anchor text penalties, since the links are as natural as it gets. So my questions is, would there be any benefit from 301 redirecting that site to his new business? The new business is in almost exactly the same niche as the old site. I am thinking of 301'ing to a sub-page which will refer to his past venture with the old business, not to the homepage of the new site. Thanks in advance for your help.
Intermediate & Advanced SEO | | rayvensoft0 -
Aged domain and 301 redirect? (11 year old domain)
Hey everyone, I'm about to launch a new website for an accounting firm. They currently have a website, which has an 11 year old domain. They are doing very well locally for SEO, and i'm guessing it's because of the aged domain, as their website is very badly built, and contains almost no content. They would like to launch the new site with a simpler, easier to remember domain. If i launch the new site, point the aged domain using a 301 redirect, and do redirects for all of the old pages to the newer versions of them, is there a chance the company will lose their current SEO rankings? Thanks!
Intermediate & Advanced SEO | | RCDesign740