301 Redirect with index.asp
-
I am very new to all of this so forgive the newbie questions I will get better. Ok so after starting a campaign I see that I have many issues including where some pages are being deemed as duplicate content.
1. The report says the http://lucid8.com has duplicate content on 2 other pages
2. When I look at them it shows that http://lucid8.com/index.asp and http://www.lucid8.com are duplicates.
3. Really these are the exactly the same page because the default page that is opened for www.lucid8.com http://www.lucid8.com etc always opens the index.asp page.
4. Now I read that I should do permanent redirects and how to do this via IIS and I tried to do a redirect from index.asp to www.lucid8.com but that does not work because www.lucid8.com is pointing to index.asp and so we end up in a circle.
So the question is how do I get rid of these duplicate page references without causing problems.
Thanks
-
Yeah a major pain and went round and round since it was happening on all machines. Once I got a machine that didn't do it it got me thinking..
Anyway hope it helps others in the future
-
That's brutal! I've seen something like that happen watching the HTTP responses via httpfox sometimes, where I've made a change on the server to a redirection and not seeing it in the browser.
-
Hey thought that I would also mention that the issue where it was referring from Lucid8.com to Https://Lucid8.com was actually a bug in firefox. Apparently FF has a bug where IF you ever went to say Https://Lucid8.com in the past, even though you enter lucid8.com it will autocorrect upon submission and send you to Https://Lucid8.com
They say that removing the HTTPS items from history will fix it, but in my case it did not and instead I had to export all my bookmarks, kill off the profile and then import the bookmarks again and now all is well.
-
Good, I'm glad you got this all working. MC
-
ok so I figured out a workaround since it appears that because I am on IIS6 the web.config is a but finicky aka may or may not work for redirection. Anyway I used the information in this link http://johnnycode.com/2012/01/04/in-iis6-http-301-redirect-from-non-www-to-www/ to create a now non-www site and point it to the www site and all seems to be working well, expect if a person puts in a HTTPS within the WWW but that should be a really rare event so I am not going to hassle with it. I also got rid of the relative URLS on the website and made them all explicit.
Fingers crossed that next run will show this issue is cleaned up....
Thanks for all your help and patience
-
Sounds like something in a web.config file. Is there possibly a web.config file in a higher-level folder?
Or, perhaps there's an IIS plugin that you're using that is doing this?
-
Yup something very strange. So it appears that
1. the redirect code in the web.config does not work
2. I may have something else going on because whenever I enter lucid8.com it redirects to https://www.lucid8.com so wondering if you have any ideas as to how I might track down WHAT exactly is making the page change to from Lucid8.com to https://www.lucid8.com???
-
Yes, that looks to me like 2 clues that both say that the web.config isn't being read for some reason.
-
Hmm well no all seems to be working well here, although the code in the web.config doesn't seem to be working for redirects, i.e. I can put in lucid8.com and it does not change to www.lucid8.com so maybe its not picking up the changes in web.config?
-
If your default document is index.asp, and you're redirecting index.asp to /, then I would expect you'd get an infinite redirection loop.
-
Sorry for the delayed response, been buried putting out other fires. That said
1. The web.config has the following in place so it refers to /
<rewritemaps><rewritemap name="Redirect"><add key="/index.asp" value="/"></add></rewritemap></rewritemaps>
2. All of my menu systems and links now reference the home page as www.lucid8.com or as / which I assume should not be an issue?
3. The only issue outstanding is your recommendation to
A: copy index.asp to home.asp
B: then would I strip the entire contents from index.asp and put some type of code within to tell it to look at home.asp? if so any help you have here would be appreciated.
NOTE: I am still a bit lost as to why I would have to do 3.a & b since steps 1 & 2 would seem to resolve the issue, but perhaps I am missing a critical point?
-
Sorry for the delay in response, had another fire to deal with....
Anyway I put this in place and it just doesn't seem to work, i.e.
1. if I put in lucid8.com I would expect it to correct itself to www.lucid8.com or http://www.lucid8.com however instead it just opens the page and keeps lucid8.com in the URL. Any ideas here?
2. I also notice that from that point on when I click to navigate to another place on the site that the URL stays without the www and I am going to guess that is because some of the pages have ABSOLUTE paths, i.e. www.lucid8.com/purchase/login.asp while others are relative, i.e /purchase/login.asp
So I guess two questions here i.e.
A: any idea how to track down why the redirect in the web.config is not working?
B: if we get # 1 working will it solve the # 2 issue or do we need to change all relative paths to absolute?
thanks
-
Excellent Info
thanks
-
You're pretty much on track with this now. The key points are:
- nothing outside of your web config file should be aware of what your home page's file name actually is
- Googlebot, your menu, etc. should all see your home page as /
- any existing links to index.asp should be 301 redirected to / to consolidate the link juice
And, the reason you're renaming index.asp to something else is that otherwise you'd have an infinite redirection loop of index.asp -> / -> gets resolved to index.asp -> / -> ....
-
I'll second Mike's comment about using Screaming Frog to test immediately.
The only thing I'll add is that it's worth doing an httpfox test of one example page to make sure you don't have a chain of redirects from your combinations of rules--Screaming Frog will just show you 1 of the response codes per page (it's unclear to me if it's the first or the the last response code). You'll catch things like one of the redirects in the chain being a 302 not a 301 (for instance, a basic Response.Redirect in the ASP code itself does a 302, not a 301!).
-
MatchAll means that all of the conditions must be met for the rule to process. It has nothing to do with case sensitivity.
Give this a whirl (I added your example of including a purchase folder in the rule):
<system.webserver><rewrite><rewritemaps><rewritemap name="Redirect"><add key="/index.asp" value="/"></add></rewritemap></rewritemaps>
<rules><rule name="CanonicalHostNameRule" enabled="true"><match url="(.)"><conditions logicalgrouping="MatchAll" trackallcaptures="false"><add input="{HTTPS}" pattern="^ON$">
<add input="{HTTP_HOST}" pattern="^www.lucid8.com$" negate="true"></add></add></conditions>
<action type="Redirect" url="<a href=" http:="" www.lucid8.com="" {r:1"="">http://www.lucid8.com/{R:1}" redirectType="Permanent" />
</action></match></rule>
<rule name="AllHTTPexceptSIGNIN" stopprocessing="true"><conditions><add input="{HTTP_HOST}" pattern="<a href=" http:="" (www.)(.)$"="">http://(www.)(.*)$" negate="true" />
<add input="{HTTPS}" pattern="on"><add input="{URL}" pattern="download" negate="true"><add input="{URL}" pattern="purchase" negate="true"></add></add></add></add></conditions>
<action type="Redirect" url="<a href=" http:="" {http_host}="" {r:0"="">http://{HTTP_HOST}/{R:0}" redirectType="Permanent"/>
</action></rule></rules></rewrite></system.webserver> -
ok thats great information since we only have a few sections where HTTPS is enforced and the cleaner I can make things the better.
That said here is what I have now in my web.config file so
1. how would I best integrate what you have above with this?
2. As I add new sections for HTTPS is it a single line for each new pattern, i.e. like "purchase" for example.
3. Am I correct that the "MatchAll" is for non case sensitivity?
<system.webserver><rewrite><rewritemaps><rewritemap name="Redirect"><add key="/index.asp" value="/"></add></rewritemap></rewritemaps>
<rules><rule name="CanonicalHostNameRule" enabled="true"><match url="(.*)"><conditions logicalgrouping="MatchAll" trackallcaptures="false"><add input="{HTTPS}" pattern="^ON$"><add input="{HTTP_HOST}" pattern="^www.lucid8.com$" negate="true"></add></add></conditions>
<action type="Redirect" url="http://www.lucid8.com/{R:1}" redirecttype="Permanent" =""></action></match></rule></rules></rewrite></system.webserver> -
Excellent information and it appears that today is my next crawl date. I will also take a look at screaming frog to see what it is all about. Thanks much for all your help and insight its invaluable. I am stuck trying to do this myself because of budgetary reasons and also my past experience with so called SEO experts was not so great... Lots of posers out there, however tools like this and these message boards make it much better and also easier to find other people to work with in the future.
Thanks again Mike
Troy
-
If you go to your campaign overview page, you will see a little box below the mini overviews that will say something like, "Last Crawl Completed: Apr. 3rd, 2013 Next Crawl Starts: Apr. 10th, 2013"
I personally use SEOmoz PRO tools in combination with Screaming Frog. I verify many of the problems using Screaming Frog, then fix them, then rescan (which is instant), then wait for my SEOmoz PRO tools to reflect my changes. SEOmoz does a great job of warning you and keeping you in the know... where Screaming Frog gives you a lot of information, but you really have to know what you are looking for and would have to keep on top of it... SEOmoz is more automated... if that makes sense.
Mike
-
The only thing that can happen is if Google indexes an http and https version of the same page. It isn't a HUGE deal... just depends on how obsessed you are about the site structure.
You could potentially have visitors start linking to the https version vs the http version, in which case that would be a problem.
Depending on the complexity of your site and code, this rule may be able to help you... where it says, pattern="download" that means that if someone visits the downloads section of your website, it will allow for https. You can continue to add additional folders by just repeating that code and replacing "download" with whatever the folder names are that you want to allow to use HTTPS. I did a Google search of site:lucid8.com inurl:https and noticed that your download section was indexed as using HTTPS, that is why I used it in this example.
If you are just using simple folder structures, this rule is not too bad to implement. I previously just implemented it with pattern matching and that was not fun.
Any way, if it helps great, if not, just try to keep your internal linking as consistent as possible. Sometimes the best way to do this is use absolute paths vs relative.
Mike
<rule name="AllHTTPexceptSIGNIN" stopprocessing="true"><conditions><add input="{HTTP_HOST}" pattern="<a href=" http:="" (www.)(.)$"="">http://(www.)(.)$" negate="true" />
<add input="{HTTPS}" pattern="on"><add input="{URL}" pattern="download" negate="true"></add></add></add></conditions>
<action type="Redirect" url="<a href=" http:="" {http_host}="" {r:0"="">http://{HTTP_HOST}/{R:0}" redirectType="Permanent"/>
</action></rule> -
So the weekly scan from SEOmoz, will that happen one week from the original scan date or? And if so will the campaign show when the scan has been updated or will I get a notification that its been updated or??
Just trying to figure out how to best use the tool and how long to wait for changes to appear in SEOmoz before I can mark an issue internally as being resolved so I can move on to the others
-
ok so I corrected all the internal references by taking out the explicit use of index.asp so moving forward that would seem to be solved.
However that said is the premise here that index.asp is already seen as a separate page from www.lucid8.com and therefore should become the reference page to a copy of itself called home.asp or whatever so that anything out there pointing to index.asp will now get consolidated into the new home.asp file and that when that happens it will resolve any issue with the search engines thinking that www.lucid8.com and www.lucid8.com/index.asp are different?
-
We do use HTTPS in different sections on the site. I played with a few things however it appears that unless you get complex there is no easy way to ensure the proper pages go to HTTP or HTTPS so will leave as the default of HTTPS now since it clearly does no harm in opening a non HTTPS page as HTTPS unless there is something I am missing??
-
You can thoroughly test these your self using the Firefox plugin httpfox.
The advantage this particular tool has over pretty much everything else is that you see not only the LAST http response code, but the entire chain.
I've answered private Q&A questions here from people where Google was seeing one of the response codes in the chain, but other tools were seeing a different one. If I remember correctly, it was a chain of 301s and 302s.
You want (ideally) a SINGLE 301; if you cannot make that happen, then a chain of 301s, with no 302s or 404s in the middle.
-
Cool. Glad to help.
Taking care of https is another rule that you would need to implement. This can be a bit more tricky if your site uses https for other purposes (such as signing in or a checkout process, etc.)
If you do not use https anywhere on your site, I can probably come up with some code that would work for you.
The SEOmoz scan is done on a weekly basis, so there isn't much you can do there. And as for other tools to do these scans, you really cannot get the level of detail in a user-friendly manner that SEOmoz provides - in my opinion.
Mike
-
Mike I think that did the trick, which is awesome!!! I validated the results by entering lucid8.com and it redirected me, however it added HTTPS vs the default of HTTP i.e. i got https://www.lucid8.com/ vs. http://www.lucid8.com/
Therefore;
1. Does the code above need to be modified or do I need to change some other setting
2. Is there a more robust way of validating these resolutions, i.e. if I do a new scan with SEOmoz will it immediately report that the issues have been fixed or ??? OR are there other methods to ensure I fixed these two issues completely?
-
If you are using IIS, then you would want to configure these fixes in your web.config file.
I think you'd want something like this:
<configuration><system.webserver><rewrite><rewritemaps><rewritemap name="Redirect"><add key="/index.asp" value="/"></add></rewritemap></rewritemaps>
<rules><rule name="CanonicalHostNameRule" enabled="true"><match url="(.*)"><conditions logicalgrouping="MatchAll" trackallcaptures="false"><add input="{HTTP_HOST}" pattern="^www.lucid8.com$" negate="true"></add></conditions>
<action type="Redirect" url="http://www.lucid8.com/{R:1}"></action></match></rule></rules></rewrite></system.webserver></configuration>If that does not work, I would recommend breaking it into sections - for example, try doing the redirect code first, then the canonical code second, or vise versa. I always look up examples of web.config configurations on stackoverflow.com.
Hope this helps Troy.
Mike
-
FYI you'll want to rename index.asp to something else, and then change the default document to point to the new filename (e.g. "home.asp"), then 301 redirect index.asp to /. This will consolidate any link juice currently going to index.asp onto your one real home page, "/".
When you think you're all done, then use the Firefox plugin HTTPfox to see your entire HTTP response code stream when you hit index.asp, the non-www version of your site, etc. You're looking to see a single 301 redirect for each.
-
-
BTW I Googled the issue and then poked around IIS on could not find any type of duplicate entry for www vs non www, however perhaps I am missing something simple? The entry that I have for the main site doesn't seem to say whether its for WWW or Non-WWW either so?
Also read an article that said this might be the cause of a duplicate DNS entry, i.e. one for WWW and one for non WWW??
-
Mike sorry for the delay in response....
I am using IIS on a Windows 2003 Server
-
That is a change you will make on your server.
Depending on the backend software you use, the code or setting to implement this type of change will be different.
What software do you use?
Mike
-
Great info thanks guys and
1. I found and corrected the /index.asp issue and am searching to ensure that issue is resolved on all other pages as well
2. Regarding the http://lucid8.com and http://www.lucid8.com I am confused as to where this is set or how to adjust. Can you provide any additional hints as to how I should address this?
Thanks to both of you this has been a great help!
-
excellent catch, Mike. He's absolutely correct about the index.asp page.
these two fixes should really help your site.
-
Hi Troy,
The issue with /index.asp is coming up because of your Home link in your footer. Instead of resolving to home "/" it is being pointed to "/index.asp".
And the reason it is also showing the www-version is because when the crawler is on lucid8.com and it crawls the link to the right of customer/partner login "customers", the crawler is brought to www.lucid8.com/downloadplus/Resource_login.asp Then, from here, if you click on any of the hyperlinks, you are brought to the www-version of the page instead of the non-www you specified as your preferred.
Jesse is correct in saying you need to choose either a www or non-www version; however, you also need to fix the /index.asp issue.
Hope this helps.
Mike
-
i think that because you said "http://lucid8.com/index.asp and http://www.lucid8.com are duplicates" your issue might actually be in the www and non-www canonicalization of your site.
Make sure that you pick one or the other (i recommend www) and in your IIS server settings redirect the non-www to the www. (or vice versa if you must)
This should solve your problem.
**update -- I just went to your site and yes this is happening. You have two sites going, http://lucid8.com and http://www.lucid8.com. The "index.asp" portion of it actually has nothing to do with this. But Google is currently seeing each version as two separate pages, resulting in duplicates of every page on that domain.
Definitely add the 301 redirect in your IIS settings to one or the other. A linkrel=canonical tag wouldn't hurt on each page either, but isn't necessary.
Good luck
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 for all urls - legal dispute
The website in question is a very high traffic website with substantial credibility in it's subject matter (sorry, can't share more details) that delivers an overwhelming majority of traffic from SEO, much of which is new visitors. A legal dispute has resulted in both parties agreeing to forward a percentage of the total URLs to alternative websites (only 1 website for each party). All URLs for the domain will be forwarded elsewhere. It does not make sense to me that the "sum of the parts" will be as strong once the redirects are implemented but I am looking for feedback. It is fair to say that the alternative domains of each party are no where near as strong as the domain being "parted out." Will the SEO juice be distributed to each domain in full? Will both parties lose out substantially? Feel free to ask for clarifications and I'll do the best I can given the legal parameters. Thanks.
Technical SEO | | ReachMaineAgency0 -
Pages with 301 redirects showing as 200 when crawled using RogerBot
Hi guys, I recently did an audit for a client and ran a crawl on the site using RogerBot. We quickly noticed that all but one page was showing as status code 200, but we knew that there were a lot of 301 redirects in place. When our developers checked it, they saw the pages as 301s, as did the Moz toolbar. If page A redirected to page B, our developers and the Moz toolbar saw page A as 301 and page B as 200. However the crawl showed both page A and page B as 200. Does anyone have any idea why the crawl may have been showing the status codes as 200? We've checked and the redirect is definitely in place for the user, but our worry is that there could be an issue with duplicate content if a crawler isn't picking up on the 301 redirect. Thanks!
Technical SEO | | Welford-Media0 -
Will doing a 301 redirect for one domain to another give the latter domain the formers links?
I have some websites that I built a few years ago that are still in existence, but I no longer have access to the sites as they weren't hosted by myself. These sites all carry a "Designed by Me" text on the footer with a link to my (now old) website. I have since done 301 redirects on the domain names that are used in the footers of these sites so they link directly to my new site. However, will these websites now show up on Google Webmasters for example as external links to my site?
Technical SEO | | mickburkesnr0 -
Soft 404's on a 301 Redirect...Why?
So we launched a site about a month ago. Our old site had an extensive library of health content that went away with the relaunch. We redirected this entire section of the site to the new education materials, but we've yet to see this reflected in the index or in GWT. In fact, we're getting close to 500 soft 404's in GWT. Our development team confirmed for me that the 301 redirect is configured correctly. Is it just a waiting game at this point or is there something I might be missing? Any help is appreciated. Thanks!
Technical SEO | | MJTrevens0 -
I need to know more clearance on rel=canonical usage than 301 redirects ?
Hi all SEOmozs, As we all know purposes of rel=canonical , I have a query to ask that If we don't have any possibility to use 301 redirects on a domain , can it be really right to use rel=canonical on an old domain to let search engine to treat those all pages should be not priority where the domain we are being promoted in the market to list up instead that. I found this interesting Matt Cutts video http://www.youtube.com/watch?v=gJK5Uloy76g where he has told or cleared the point very nicely, yes we can use it if there is no possibility in your older domain or pages. So here i am asking the same to know more detailed clarity on this so that i can be more confidence on it. I have been seeing issues in my domains where old one domain comes than new domain why with new domain contents, and can it be really very good to bring new domain with **rel=canonical without using 301 redirect :
Technical SEO | | Futura
Old : kanin.com (leaving) New : kangarokanin.com (promoting) Where i might have not used yet the rel=canonical in old domain, will be going to use it soon , after finishing this discussion.** Regards,
Teginder Ravi tcSnN.jpg tcSnN.jpg dGd34.jpg0 -
302 to 301 redirect
Our site has quite a few 302 redirects that really ought to be 301's. Our IT department is really busy so the question is, given that the 302's have probably been in place for years, is it worth changing them to 301's now? Thanks
Technical SEO | | Houses0 -
Could a URL change path conflict a 301 redirect?
Hi Mozzers, We create multiple pages for one of my client. Some of them are replacing old pages. I setup 5 of them out of 40. I was able to set them live via the drupal CMS. The new pages were actually published but didn't have any URL but had nodes in directory such as www.example.com/node298. To set them live i changed the url path to one page that already existed( www.example.com/old). In order to setup the replacing page: www.example.com/node298 i added the same name as the old one but in order to avoid URL conflicts with new page(www.example.com/new) I had to change the old page's url path as well such as www.example.com/old2) I know i have to 301 redirect the old to the new obviously but my question is: does a URL path change on the old page www.example.com/old matters in when 301 ing it? will it still transfer all the juice to the new page Visual Process: Main goal: www.example.com/old redirect to www.example.com/new but these two are exactly the same url So modification of URL path: www.example.com/old to www.example.com/old2 to avoid URL conflict Therefore www.example.com/old2 =www.example.com/old (just url change path difference) Question: Because of this url change, will a 301 from www.example.com/old2 to www.example.com/new will still carry all the juice that www.example.com/old carried or not? I hope i didn't make it too confusing. Let me know if it is the case Thanks Mozzers Ty
Technical SEO | | Ideas-Money-Art0 -
Accidently did a 301 redirect on root domain and lost domain keyword position
I just bought a domain about a week ago and instantly ranked number 4 for for my keywords with the domain keyword bonus. I created a landing page off the root of my domain while I'm building out my main site. I accidentally did a 301 redirect instead of a 302 from my root to my landing paging and this resulted in me losing my position and only being about to find my domain in the google if I searched for my domain specifically. Anyway to regain my original position? I have removed the redirect. Have I been put in the sandbox?
Technical SEO | | JohnTurner790