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.
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
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
-
Should I no-index categories of my blog?
I have blog with lots of articles & it also has lots of categories. These categories are currently indexed in the google and moz showing missing title and description for these categories. Should I place no-index tag in all the categories or leave it as it is?
Intermediate & Advanced SEO | | jhakasseo0 -
Is it best to 301 redirect or use canonical Url when consolidating two pages?
I have build several pages (A and B) with high quantity content. Page A is aged and gets lots of organic traffic, ranks for lots of valuable keywords, and has only internal links to this page. Page B is newer (6 months) and gets little traffic, ranks for no keywords, but has terrific content and many high value external links. As Page A and B are related to a similar theme, I was going to merge content from page B onto page A, but don't know which would be the best approach for handling the links going to page B. For the purposes of keep as much link equity as possible, is it best to us a 301 redirect from B to A or use a canonical URL from B to A?
Intermediate & Advanced SEO | | Cutopia0 -
301 redirect to search results page?
Hi - we just launched our redesigned website. On the previous site, we had multiple .html pages that contained links to supporting pdf documentation. On this new site, we no longer have those .html landing pages containing the links. The question came up, should we do a search on our site to gather a single link that contains all pdf links from the previous site, and set up a redirect? It's my understanding that you wouldn't want google to index a search results page on your website. Example: old site had the link http://www.oldsite.com/technical-documents.html new site, to see those same links would be like: http://www.newsite.com/resources/search?View+Results=&f[]=categories%3A196
Intermediate & Advanced SEO | | Jenny10 -
Google Not Seeing My 301's
Good Morning! So I have recently been putting in a LOT of 301's into the .htaccess, no 301 plugins here, and GWMT is still seeing a lot of the pages as soft 404's. I mark them as fixed, but they come back. I will also note, the previous webmaster has ample code in our htaccess which is rewriting our URL structure. I don't know if that is actually having any effect on the issue but I thought I would add that. All fo the 301's are working, Google isn't seeing them. Thanks Guys!
Intermediate & Advanced SEO | | HashtagHustler0 -
Redirect Search Results to Category Pages
I am planning redirect the search results to it's matching category page to avoid having two indexed pages of essentially the same content. Example http://www.example.com/search/?kw=sunglasses
Intermediate & Advanced SEO | | WizardOfMoz
wil be redirected to
http://www.example.com/category/sunglasses/ Is this a good idea? What are the possible negative effect if I go this route? Thanks.0 -
301 redirect and improved ranking
I was wondering if a 301 redirect will improve my ranking. My subpages use to redirect to my homepage ( all the subpages of my site redirecting to my homepage) and my homepage use to have no redirect from non www.to www. ( other than thru google webmaster tools. I am sure why it was like this for my subpages... I was wondering if I can expect some improvements in ranking now that the redirect goes from the none www. to the www version of each subpage and not to the homepage. By the way what was the issue ( was I telling google ) by re-directing all my subpages to the homepage ? was I making google think that my subpages and my homepage were all the same ? was I sending all the link juice from the subpages to my homepage ? etc... Thank you,
Intermediate & Advanced SEO | | seoanalytics0 -
How to properly link to products from category pages?
Hi All, We have an e-commerce website and the category pages are built so that there is a product image and below it there is the title. Both the image and the title are in a href (each on its own). I encountered the following unfinished discussion here at MOZ:
Intermediate & Advanced SEO | | BeytzNet
http://www.seomoz.org/q/how-to-optimize-achor-text-links-on-ecommerce-category-page#post-93758 The discussion states that its improper. The question is - if it is wrong then why? (maybe because Google will give its weight to the image anchor instead of the text anchor since it is higher in the page). The other question is how to resolve the matter?
Should I add nofollow to the image href? Thanks0 -
Anyone Used ScrapeBox or SEONukeX Before?
I have been looking at trying out Scrapebox or SEONukex for a while, but don't want to wast my money. Has anyone tried them out with positive success? I am not looking for an automated submission platform necessarily. I am simply looking for a platform to tell me which sites are relevant to mine, dofollow, etc. That is what I would be using them for.
Intermediate & Advanced SEO | | MyNet0