301 redirect help
-
Hey guys, I normally work in WordPress and just use a 301 redirect plugin. I bought a site and rather than maintain two similar ones have decided to redirect one to the other.
I am having trouble with the .htaccess file. Here is an example. These are two redirects:
redirect 301 /category/models/next/2
redirect 301 /category/modelsI want both of these URLs to redirect to the same URL of the new site. However, the /category/models is the only one working. It redirects to the new page just fine. The /category/models/next/2 is redirecting to nearly the same URL on the new site, only it is adding /next/2 to the end and that is bringing up a 404.
Why is it adding /next/2 to the new URL? How can I fix this? There are several doing this. Help appreciated!
-
Hi,
I just did this and had similar issues
It looks like the .htaccess is correct at the old domain.
but you need to put in re-directors at the new domain that will take in these extra items due to these directories do not exist at the new domain.
There could be an easier way, without putting a redirect after a redirect (which possibly losses a little extra juice) but I am not aware of a way without redirecting all 404 queries.
after you have put back the 301 that was working at the OLD domain In the .htaccess at the NEW domain you would put
Redirect /category/models/next/2 http://www.example.com/
This will tell any queries for http://www.example.com/category/models/next/2
to redirect to http://www.example.com or whatever you put in....
hope this helps!
-
Didn't seem to fix it. None of the redirects worked anymore. They all just changed the domain name, not redirect to the specified URL.
-
Try changing the last line to:
RewriteRule ^(.*)$ http://new-domain.com/$1 [R=301,L]
-
This is at the top of the .htaccess file:
rewritecond %{HTTP_HOST} ^www.old-domain.com$ [OR]
rewritecond %{HTTP_HOST} ^old-domain.com$
rewriterule ^$ "http://new-domain.com/" [R=301,L]Does this need to be changed?
-
Whats in your .htaccess file at the moment?
I think in your .htaccess your redirect should be setup something along the lines of:
RewriteCond %{HTTP_HOST} ^www.old-domain.com$ [NC]
RewriteRule ^(.*)$ http://new-domain.com/$1 [R=301,L]
Someone else could probably make that a bit neater but something like this should work.
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 do a redirect
Hello, I am building a new website with a new web address for subpages. The domain name stays the same. I am wondering if I should do redirect to the few pages that have an outside link going to them. I noticed all my subpage that don't have any external link have an authority of 18. I only have 1 subpage that has 2 external links and 1 of them has a spam score of 32 and then other one of 1. My website is about a 100 pages. What should I do for my subpages redirect , not redirect, redirect only the ones that have external links ? Thank you,
Intermediate & Advanced SEO | | seoanalytics0 -
Found a cache of old domain names, should I link or 301 redirect
We have found a cache of about 10 URLs, some are ranking above our main URL in Google SERPS. What is the best course of action here? a. Redirect all to the homepage?
Intermediate & Advanced SEO | | moconn
b. Link all domains to the homepage?
c. Link all domains to select pages on on main site, being careful not to anchor text spam
d. 301 redirect all to the main site. Is there any disadvantage to your recommendation? Is there likely to be a penalty incurred? I feel like we'll get the strongest increase in rankings by following option c but it feels like option d may be safer. Thanks in advance for your help!0 -
301 redirects
One of our employees took an SEO class recently. She was told that having too many 301 redirects can hurt SEO. I have never heard of 301 redirects as having a negative impact. Any thoughts?
Intermediate & Advanced SEO | | Smart_Start0 -
Htaccess redirect veriables
Hey, I'm trying to redirect all instances of "/archive_details.php?id=*" to "/public-affairs-job-archive.php". Is the below code correct? Redirect 301 /archive_details.php?id=* /public-affairs-job-archive.php Thanks, Luke.
Intermediate & Advanced SEO | | NoisyLittleMonkey0 -
Duplicate content reported on WMT for 301 redirected content
We had to 301 redirect a large number of URL's. Not Google WMT is telling me that we are having tons of duplicate page titles. When I looked into the specific URL's I realized that Google is listing an old URL's and the 301 redirected new URL as the source of the duplicate content. I confirmed the 301 redirect by using a server header tool to check the correct implementation of the 301 redirect from the old to the new URL. Question: Why is Google Webmaster Tool reporting duplicated content for these pages?
Intermediate & Advanced SEO | | SEOAccount320 -
External links point to 403 page - how to 301 redirect if no file extension?
Hi guys, After moving from an old static .htm site to Wordpress, I 301'd all old .htm urls fine to the new trailing slash foldery style /wordpress-urls/ in htaccess no problem. But Google Webmaster Tools tells me I still have hundreds of external links pointing to a similar version of the old urls (but without the .htm), giving lots of not founds and 403s. Example of the urls linked to that 403 not found: http://www.mydomain.com/filename So I'm wondering how I do a 301 redirect from a non-exisiting url that also has no file extention as above and is not like a folder? This seems like a lot of possible external link juice to lose. Thanks!
Intermediate & Advanced SEO | | emerald0 -
301 redirects and Blogger - moving blog
Is there any way to add 301 redirects to individual posts on a blogger-hosted blog? We're getting ready to finally move our blog off of Blogger and onto our own webserver. We're probably going to use BlogEngine.net to run it. right now the blog is located at blog.MySite.com. We're probably going to move it to MySite.com/Blog. We don't have any really popular posts and we only really get ~10 visits a day on about 70 posts. Just trying to figure out the best way to handle this without inadvertently shooting myself in the foot.
Intermediate & Advanced SEO | | _JP_0 -
How to do a 301 redirect for url's with this structure?
In an effort to clean up my url's I'm trying to shorten them by using a 301 redirect in my .htaccess file. How would I set up a rule to grab all urls with a specific structure to a new shorter url examples: http://www.yakangler.com/articles/reviews/other-reviews/item/article-title http://www.yakangler.com/reviews/article-title So in the example above dynamically redirect all url's with /articles/reviews/other-reviews/item/ in it to /reviews/ so http://www.yakangler.com/articles/reviews/boat-reviews/item/1550-review-nucanoe-frontier http://www.yakangler.com/articles/reviews/other-reviews/item/1551-review-spyderco-salt http://www.yakangler.com/articles/reviews/fishing-gear-reviews/item/1524-slayer-inc-sinister-swim-tail would be... http://www.yakangler.com/reviews/1550-review-nucanoe-frontier http://www.yakangler.com/reviews/1551-review-spyderco-salt http://www.yakangler.com/reviews/1524-slayer-inc-sinister-swim-tail with one 301 redirect rule in my .htaccess file.
Intermediate & Advanced SEO | | mr_w0