301 redirects and Dynamic URLs
-
I just ran my first diagnostic and one of my primary immediate problems are duplicate titles and duplicate content. My guess it that because the root URL http://sitename.com (which has not yet been redirected to www...) has generated an entire tree of content which is identical to the tree rooted at http://www.sitename.com.
QUESTION:
Do I need to do a redirect simply for the root url (sitename.com -> www.sitename.com) or do I now need to develop specific 301 redirects for each of the sub-nodes/pages?
ie
sitename.com/?q=about-us -> www.sitename.com/?q=about-us
sitename.com/?q=our-team -> www.sitename.com/?q=our-team
etc.
-
Thanks for the help - my gut tells me that I shouldn't have to do it for every possible iteration that could be generated.
So if I redirect the root url and Google has already indexed interior pages using the non-www url, will Google (et al) systematically revisit all the old links or start again at the root directory and have the (no longer) duplicate content just fall off the results pages and stop impacting my relevance?
-
Hi,
I have never heard of doing a single redirect for each individual page to redirect non www to www (and not sure how one would do that, not sure it is possible as an infinite loop would be caused)
but below is how to do it in both Apache .htaccess and IIS 7.0 using URLrewrite
Apache = Must have rewrite_module modules/mod_rewrite.so
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]IIS= URL Rewrite http://blogs.msdn.com/b/carlosag/archive/2008/09/02/iis7urlrewriteseo.aspx<configuration> <system.webServer> <rewrite> <rules> <rule name="Redirect to WWW" stopProcessing="true"> <match url=".*" />
<conditions> <add input="{HTTP_HOST}" pattern="^example.com$" />
conditions> <action type="Redirect" url="http://www.example.com/{R:0}" redirectType="Permanent" />
rule> rules> rewrite> system.webServer> configuration>hope this helps
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
-
Over 500 thin URLs indexed from dynamically created pages (for lightboxes)
I have a client who has a resources section. This section is primarily devoted to definitions of terms in the industry. These definitions appear in colored boxes that, when you click on them, turn into a lightbox with their own unique URL. Example URL: /resources/?resource=dlna The information for these lightboxes is pulled from a standard page: /resources/dlna. Both are indexed, resulting in over 500 indexed pages that are either a simple lightbox or a full page with very minimal content. My question is this: Should they be de-indexed? Another option I'm knocking around is working with the client to create Skyscraper pages, but this is obviously a massive undertaking given how many they have. Would appreciate your thoughts. Thanks.
Technical SEO | | Alces0 -
301 Redirect Url Within a Canonical Tag
So this might sounds like a silly question... A client of mine has a duplicate content issue which will be fixed using canonical tags. We are also providing them with an updated URL structure meaning rwe will be having to do lots of 301 redirects. The URL structure is a much larger task that than the duplicate content so i planned to set up the canonicals first. Then it occurred to me id be updating the canonical tags with the urls from the old structure which brings me to my question. Will the canonical tags with the old urls redirect credit to the new urls with the 301? Or should i just wait until we have the new url structure in place and use these new urls in the canonicals? Thanks!
Technical SEO | | NickG-1230 -
301 Redirects
Hi, We have migrated to a new domain name and I wrote my redirects as follows: Redirect 301 / http://www.healthpointe.net Redirect 301 /urgent_care_locations.shtml http://www.healthpointe.net/healthpointe-locations/ Redirect 301 /locations.shtml http://www.healthpointe.net/healthpointe-locations/ Redirect 301 /career_client_relations_rep.shtml http://www.healthpointe.net/careers/ My issue is that when I include the first redirect, which is to the main page of the website that the other redirects stop working. Any idea what the problem could be?
Technical SEO | | healthpointeseo0 -
Redirecting a Few URLS from One Domain to Another
Hello, I have two websites within a similar niche...some of the top organic traffic driving pages on Website B I'd like to redirect to a similar page on Website A. The reason is Website A is a bigger and better and is monetized much better as well. I only want to redirect a few of the main URLS on Website A and also only those that I have similar content on my main Website B. Is this process safe for SEO? What is the best way to go about this process. I am not really concerned with Website B and what happens to it's rankings, but in the meantime, I'd like to redirect the traffic from some of it's main organic traffic driving pages to my main website A and to it's similar pages. I am also concerned with making sure my main website A stays white hat and doesn't receive any negativity from these redirects. Thanks.
Technical SEO | | juicyresults0 -
301 redirect relative or absolute path?
Hello everyone, Recently we've changed the URL structure on our website, and of course we had to 301 redirect the old urls to the coresponding new ones. The way the technical guys did this is: "http://www.domain.com/old-url.html" 301 redirect to "/new-url.html"
Technical SEO | | Silviu
meaning as a relative redirect path, not an absolute one like this:
"http://www.domain.com/old-url.html" 301 redirect to "http://www.domain.com/new-url.html" This happened for few thousands urls, and the fact is the organic traffic dropped for those pages after this change. (no other changes were made on these pages and the new urls are as seo friendly as possible, A grade on On-Page Grader). The question is: does the relative redirect negatively affects seo, or it counts the same as an absolute path redirect? Thanks,
S.0 -
Can you do a 301 redirect without a hosting account?
Trying to retire domain1 and 301 it to domain2 - just don't want to get stuck having to pay the old hosting provider simply to serve a .htaccess file with the redirect rule.
Technical SEO | | TitanDigital0 -
What if my host doesn't have the 301 redirect feature?
Ok, So i need to do a 301 redirect but my host doesn't have the feature with htaccess. I currently use yahoo. What are my options?
Technical SEO | | bronxpad0 -
Redirects 301
Hello, I need to reedirect a URL of a page that I have in my site (http://digitaldiscovery.com.pt/servicos-de-marketing-digital/publicidade-online/) to a new URL with SEO porpuses. Whats the best way to this? I use Wordpress btw. Tks in advance! PP
Technical SEO | | PedroM0