301 redirect issues
-
Hi all,
I'm hoping someone will be able to help me with an extermley frustrating problem with 301 redirects in .htaccess.
Basically I'm trying to redirect some old pages (from our old website) that stil rank to the new equivilent.
For example -
old url =
www.domain.com/frames/news/company-news/news-reader.php?newsStoryID=395
New
www.domain.com/news/article-title
I've tried the simple
redirect 301 /frames/news/company-news/news-reader.php?newsStoryID=395 http://www.domain.com/news/article-title
But this doesnt work. I've also tried -
RewriteEngine on
RewriteCond %{QUERY_STRING} ^newsStoryID=395$
RewriteRule ^/news-reader.php$ http://www.domain.com/news/article-title/? [L,R=301]Could anyone help? I've followed lots of tutorials that all match the above but it just doesn't work! The only other thing within the htaccess file is from wordpress for pretty permalinks -
BEGIN WordPress
<ifmodule mod_rewrite.c="">RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]</ifmodule>END WordPress
Many thanks in advance!
-
Thanks for the link, the plugin works a treat! Life saver.
-
My mistake, it's the Redirection plugin (http://wordpress.org/extend/plugins/redirection/), not Redirect. I use it on my site, and use it to redirect incoming links from another domain that's blanket 301ing to my site, and it was never on wordpress. There's an easy way to look at the 404s to your site and set up a redirect from the 404 page (handy if someone did a typo on a URL to you, accidentally added a period to the hyperlink, etc.)
-
Thanks for the reply. I've taken a look at the plugin (don't really like usings them and normally just write my own) but it doesn't look to be able to handle historical pages - from before the site was build in wordpress.
-
Not a direct answer to your question, but I personally use and like the Redirect plugin for Wordpress. Have you tried something like that? I'm not an htaccess expert, so can't help you out otherwise.
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
-
301 Redirects in subfolders
Hi, we're making our site into a static site but I would like to transfer the Google juice. Most of the links and database exist on subfolders though. Could I simply do 301 redirects on the subfolders and retain the value or does it have to be on the full domain?
Technical SEO | | Therealmattyd0 -
CNAME vs 301 redirect
Hi all, Recently I created a website for a new client and my next job is trying to get them higher in Google. I added them in OSE and noticed some strange backlinks. To my surprise the client has about 20 domain names. All automatically poiting to (showing) the same new mainsite now. www.maindomain.nl www.maindomain.be
Technical SEO | | Houdoe
www.maindomain.eu
www.maindomain.com
www.otherdomain.nl
www.otherdomain.com
... Some of these domains have backlinks too (but not so much). I suggested to 301 redirect them all to the main site. Just to avoid duplicate content. But now the webhoster comes into play: "It's a problem, client has only 1 hosting account, blablabla...". They told me they could CNAME the 20 domains to the main domain. Or A-record them to an IP address. This is too technical stuff for me. So my concrete questions are: Is it smart to do anything at all or am I just harming my client? The main site is ranking pretty well now. And some backlinks are from their copy sites (probably because everywhere the logo links to the full mainsite url). Does the CNAME or A-record solution has the same effect as a 301 redirect, from SEO perspective? Many thanks,
Hans0 -
Best Practice on 301 Redirect - Images
We have two sites that sell the same products. We have decided to retire one of the sites as we'd like to focus on one property. I know best practice is to redirect apples to apples, which in our case is easily done since the sites sold the same thing. www.SiteABC.com/ProductA can be redirected to www.SiteXYZ.com/ProductA. My question is how far does that thinking go regarding images? Each product has a main product page, of course, and then up to 6 images in some cases. Is it necessary to redirect www.SiteABC.com/ProductA-Image1.jpg to www.SiteXYZ.com/ProductA-Image1.jpg? Or can they all be redirected to just the product page?
Technical SEO | | Natitude0 -
301 redirect all 404 pages
Hi I would like to have a second opinion on this. I am working on an ecommerce website that they 301 redirect all 404 pages (including the URLs entered incorrectly) to the “All categories page”. Will this have any negative SEO impact?
Technical SEO | | iThinkMedia0 -
301 issue in IE9
My development team recently discovered an issue with 301 redirects caching in IE9. They did some research and found the situation was very complicated so their solution was to use 302s and no longer use 301s. As a temporary solution to a few URLs I was okay with this, but we have a site redesign launching in a few months and I am quite worried if we have to do all of our redirects as 302s. Has anyone else had this issue with IE9 and 301s. I could use any advice on how to overcome this issue. Thanks!
Technical SEO | | SEI0 -
301 Redirects Not Allowed by Host
Not sure if anyone has an answer, but we have a client who has an ecommerce store with SBI! The client has a new site with a new store builder/host and wants to 301 redirect all of the old site's indexed pages to the new site. However, we were just informed by SBI! that 301 redirects are not allowed - even more, they don't even grant FTP access. Any brilliant ideas from anyone how we can get around this?? Thank you!
Technical SEO | | roundabout0 -
Rel=cannonical + 301 redirect
Hi All I am currently working on a DotNetNuke site. I have enabled friendly URL's which have changed the url structure from the default setting of TabId=x to whatever the page name is set as. I will use the following page as an example - www.notarealdomain./graphicdesign.aspx Now I would like to know if it would be worth my time to change this to "/graphic-design.aspx through the use of a 301 redirect and/or a rel=can. Any help would be much appreciated. Thanks
Technical SEO | | masterpete0 -
Should I 301 redirect my country specific sites, or use them as linking root domains?
I have loveelectronics.co.uk, but I also own 10 other country code specific domains. I am short on links (i'm actually still setting up the website) and wondered that until i have country specific content, should I 301 redirect these websites to the homepage of my main site, or could I use them as links which would mean I have more linking root domains? Sorry if this is a beginner question, but it would be good to know so I can sort this.
Technical SEO | | jcarter0