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
-
301 redirect impact on ranking
If Website A is ranking 19th position in Google for a specific keyword, and Website B is ranking 30th position for the same keyword, What would be impact after 301 redirect? Will Website A drop to 30th position because of 301 or existing position would improve because of link juice?
Intermediate & Advanced SEO | | riyaaaz0 -
Redirected Old Pages Still Indexed
Hello, we migrated a domain onto a new Wordpress site over a year ago. We redirected (with plugin: simple 301 redirects) all the old urls (.asp) to the corresponding new wordpress urls (non-.asp). The old pages are still indexed by Google, even though when you click on them you are redirected to the new page. Can someone tell me reasons they would still be indexed? Do you think it is hurting my rankings?
Intermediate & Advanced SEO | | phogan0 -
Help understanding 301 domain redirect
Can anyone help me understand a specific process of a 301 redirecting a domain. Here is what I would like to know.... When you 301 redirect a site, most if not all the links follow to your new site. But how does this process happen? 1.When Google sees the new domain does it simply apply the backlink profile of the old site to the new one? 2. Does it have to re-crawl all the links one by one and apply them to the new domain? 3. or something else?
Intermediate & Advanced SEO | | gazzerman10 -
Is anyone here using Triond? What do you think about it?
I noticed that a few people are using Triond.com to do "guest post".Is that a good way to diversify the link profile and get more traffic? Is anyone here using Triond? What do you guys think about the service?
Intermediate & Advanced SEO | | Felip31 -
How would you use this broken link building opportunity?
I've found a good opportunity to build some links and I'd love your opinions on my options here. There's a big event that happens once a year in my city. Let's say the event used to have a website called www.CityEvent.com. The event decided not to use this website anymore, but instead to put all of their event information on their facebook page. It looks like they let their domain name expire and someone else snapped it up. It's now sitting as an empty wordpress blog with one line of text. This empty website has 1300 links pointing to it. I can see two opportunities here: 1. Write a very thorough article on my website (that I am trying to build links to) describing the event and giving people all of the information that they need to know about it. (The amount of information on the Facebook page is minimal.) or 2. Create a new website called www.EventCity.com and put up a static page with all of the information that people need to know. There would be a link on this page pointing to the site that I am trying to rank. In both cases there would be much more information than is available on the Facebook page including a collection of youtube videos about the event and many helpful links for people who are interested in this type of event. Then the plan is to contact the sites who are linking to the dead page and invite them to link to my new page (either on my site or the new site that I could create). I see a few pros and cons to each method. For option #2 I think people would be more likely to link to a more official looking page rather than an article on a separate website. (My website has information about the city in question but is not closely related to the event at all.) However, I would only be getting one link back to my site. One negative to this is that the actual organizers of the event may not be pleased that someone has created an official looking page. But then again, perhaps they would be happy to have a free website. For option #1 I would possibly get more links from sites that are authoritative in my city that point directly to the site I am trying to rank. However, people would be less likely to link to us because we are not an official site for the event, but simply a very good article about the event. There are no other good articles for this event that are ranking on Google. Hopefully that makes sense. What would you do? EDIT - Just thought of a third option - try to buy the domain.
Intermediate & Advanced SEO | | MarieHaynes0 -
301 Redirect - What happens to backlinks
Hello... One of my sites is losing rankings in G. I received the webmaster notification of unnatural links... My question is, should i do a 301 redirect of every page on my site to a new domain? If so, do the backlinks (which i believe are causing my rankings to drop) carry over? How about the good backlinks? Also, what would happen to the rankings i currently have on page 1? Thanks
Intermediate & Advanced SEO | | Prime850 -
Choose of destination for a 301 redirection
Hi, I had a website paris-football.com which ranked quite well on specific request as 'paris football" and "paris foot". I decided 2 months ago to stop this website as I had no time to update it and it was quite rubish in terms of content and make a redirection to a better quality website. I decided to redirect to the deep url http://www.sportytrader.com/paris-foot.php . The destination Url has not beneft from the redirection and has even seen its rankings drop since the redirection. do you think that it would have been better to redirect to the Home Page http://www.sportytrader.com ? Do you think that I can still change the destination url ? Thanks a lot for your help,
Intermediate & Advanced SEO | | jarnac0 -
When using ALT tags - are spaces, hyphens or underscores preferred by Google when using multiple words?
when plugging ALT tags into images, does Google prefer spaces, hyphens, or underscores? I know with filenames, hyphens or underscores are preferred and spaces are replaced with %20. Thoughts? Thanks!
Intermediate & Advanced SEO | | BrooklynCruiser3