Redirection
-
Hi all I have these domains active:
www.piensapiensa.es
http://piensapiensa.es which redirects to www.piensapiensa.es via webmastertools
http://piensapiensa.com
www.piensapiensa.com which redirects to http://piensapiensa.com via webmastertools.
I want the last three items to redirect to www.piensapiensa.esHere is part of the code of the htaccess file that I have until now:
Options +FollowSymLinks +ExecCGI
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.piensapiensa.es [NC]
RewriteRule (.*) http://www.piensapiensa.es/$1 [R=301,L]Thanks in advanced.
-
Hi Juan Miguel,
For the non-www to www redirects, from http://piensapiensa.es to http://www.piensapiensa.es you can use:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]On the other hand, to redirect: http://piensapiensa.com and http://www.piensapiensa.com to http://www.piensapiensa.es you can use:
RewriteEngine On
RewriteBase /RewriteCond %{HTTP_HOST} ^piensapiensa.com [nc]
RewriteRule ^(.*)$ http://www.piensapiensa.es/$1 [r=301,nc,L]RewriteCond %{HTTP_HOST} ^www.piensapiensa.com [nc]
RewriteRule ^(.*)$ http://www.piensapiensa.es/$1 [r=301,nc,L]Thanks,
Aleyda
-
In theory I think this should work because because the third line is saying "grab all urls that are not htttp://www.piensapiensa.es" and then the 4th says to "change to them to htttp://www.piensapiensa.es"
You have a typo though in line 3 -
RewriteCond %{HTTP_HOST} !^www.piensapiensa.es [NC] should be
RewriteCond %{HTTP_HOST} !^www.piensapiensa.es [NC] (remove the \ between your domain name and the ".es"
As it is now it is not going to do anything for you until you fix that.
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
-
Weird 404 Error URL's - Where to redirect?
For some reason, I end up with a bunch of weird 404 error URLs like these. /KRVWZ/SVfSZ/ /wp-content/upl /MKWTZ/RKYQZ/ /wp-content/upload What should I do with them? Should I redirect them or is there a better way to do something with them. I do use Yoast Premium if that makes a difference. Thanks in advance.
On-Page Optimization | | photoseo10 -
Redirecting to homepage ok?
I deleted a bunch of category pages (renamed mostly actually and thought they'd be auto redirected like my blog posts are but they weren't) so I used a plugin that reroutes any 404 page to the homepage. Is that the best thing to do in this situation? Google Webmasters says there are about 84 404-errors and this should get rid of those right? Is there anything SEO BAD about doing it this way?
On-Page Optimization | | dealblogger0 -
302 redirect (temporary redirect)
Hello guys, I have a stupid problem, i guess you solved long time ago. After i crawl my website, i found out that i have 8k temporary redirect (302 redirect). All of them came from www.domain.com/enable-cookies, there are 8 k of this type. I guess i am not first one with magento having this problem. Could you explain what happen in fact? And more than that could you explain how to fix it? I bet people will find this thread important i will not be the last one with this problem Thank you in advance. With Respect, Andrei
On-Page Optimization | | Shanaki0 -
301 redirects, efficiency and dynamic URLs
Hi, I have 2 301 redirect questions. Question 1: I have am working with a designer on the redesign of a website that currently has over 5,000 indexed pages. The majority of these are dynamic URLs from the Stone Locator database. (see below) http://www.domain.com/storelocator.php?zipcode=91784&page=12 How can I efficiently deal with these pages from an SEO perspective when developing the new site? Is there a way to do a bulk 301 redirect to a store locator page, for instance? Question 2: If a rel=canonical tag has been established on a page (www....), is it necessary to add 301 redirects to all of the other versions on: the home page (domain.com , domain.com/index.html, domain.com/index.html, etc.) all other pages with those same extensions ? Thank you for your help! Erin
On-Page Optimization | | HiddenPeak0 -
Temporary Redirects
On my crawl report from SEOmoz, I have a lot of Temporary Redirects listed. The referring site is a product category page, but the URL listed is part of a shopping cart. For example: | http://www.adagiowaterfeatures.com/cart.php?action=add&product_id=496 | Tested true for a temporary redirect referred by this url: | http://www.adagiowaterfeatures.com/categories.php?category=Free-Standing-Water-Features/Harmony-River-Collection | Why does this occur and what can I do about it?
On-Page Optimization | | AdagioWaterFeatures0 -
Redirect a blog category page to the homepage?
Hi folks Following Penguin 1.1, I have a client site at number 5 for their primary keyword. (was creeping up page 2 with whitehat link building and tight on-site SEO.) However now the page ranking at No. 5 is for a blog category archive. What do people think the quickest / safest way to get this ranking directed back to the homepage is? Many thanks Simon
On-Page Optimization | | SCL-SEO0 -
301 Redirect to mobile site effecting rankings
On my site I redirect users when on a mobile device to be redirected to my mobile version of my site. In the last couple weeks I added that redirect in my htaccess file. I just realized today that I am doing a 301 redirect. In the last few weeks my ranking have gotten lower. I am starting to think that because of the redirect my mobile site is not as optimized as my regular site and therefor is effecting my rankings. My question is how can I redirect my users to my mobile site but not use a 301 AND how do I get google to use my main site content for ranking on the mobile side. I want to go back to getting my search rankings on the mobile side using my main sites content. Can I simply remove the 301 on the redirect? Hope that makes sense.
On-Page Optimization | | cbielich0 -
301 redirect results in plummeting DA. Why?
I redirected from my .co.uk site to my .com site (www.salesandinternetmarketing) and my Domain Authority has gone from 44 to 33!? Also SEO Moz states that it's crawled all my pages, yet isn't showing any on page reports, inculding keyword usage, meta descriptions, etc. I'm very confused and not receiving clear answers from the support team (they've said one of the reasons is that my keywords are not ranked in the top 50, well some are, nevertheless I should still be getting some report info shouldn't I)? Can someone please help, I'm rather fed up as this has been going on a for a couple of weeks now
On-Page Optimization | | lindsayjhopkins0