There’s quite a bit of confusion over 301 redirects and how they effect SEO and a sites rankings. I’ve extensively used permanent 301 redirects on both my own and SEO client sites and in this SEO tutorial I’ll explain how to use 301 redirects for a Linux Apache server and what you should expect SEO wise. I’ve NOT included a redirect tutorial for Windows Server 301 Redirects since they don’t use a .htaccess file like you use with Apache servers. Also note adding 301 redirects using a .htaccess file is not the only way to add 301 redirects for a website running under Linux, there’s PHP redirects and server side redirects added via Apache config files, so this is just […]
Continue Reading 301 Redirect Htaccess
Google Site: Search No Results
Hi, when I search for site:http://mydomain.com I get all indexed pages but when I searched for site:http://www.mydomain.com I do not get any result. Google says
Your search – site:http://www.techiezone.net – did not match any documents.
Is it good or bad?
www to non-www 301 Sitewide Redirects
Looks like you have a 301 redirect setup so the www version of your site is redirected to the non www version.
This sort of Google search:
Shows your site is indexed under the non www version.
Loading the www version of your site instantly redirects to the non-www version.
Confirms you have a 301 redirect setup, www to non-www.
Assuming you wanted your site indexed/accessed via the non-www URLs it looks good to me.
David Law
www to non-www 301 Sitewide Redirects
How Do I 301 Redirect index.html to root directory?
On a site with only one domain: How do I redirect my .com/index.html to my .com/?
When I do, does this open my directory up for all to see or does the redirect to / become my new index (default) page?
301 Redirect index.html to Root
A 301 redirect from index.html to root won’t open your directory up for all to see as long as the DirectoryIndex is set to an index.*** file that is within that directory.
Easiest way to know is test it, does loading example.com/directory/ load the same page as example.com/directory/index.html (when there’s an index.html file in that directory).
If it does it’s set. If not set it.
DirectoryIndex can be set server side (for all sites on a server) or site/directory wide via an .htaccess file.
Put something like this at the top of your .htaccess file (if it already works it’s set server side, no need to add this):
Would look for index.*** until it found one of the file types above. Order the file types in order you tend to use them as the main index file, if you only use index.php for example you’d only need:
This is the sort of code you’d add to your .htaccess file to 301 redirect /index.html to /
This will 301 redirect the index.html pages to their respective directories.
If you are finding Google is indexing index.html and you don’t want this (It won’t after adding the 301 redirect above).
1. Stop linking to example.com/index.html, make sure all links point to example.com/
2. Setup a canonical URL within the head section of your index.html file. This is a solution if you don’t have access to your .htaccess file for adding a 301 redirect, but do have access to the page code.
This will tell Google when it spiders www.example.com and www.example.com/index.html the correct URL is www.example.com
A canonical URL won’t redirect a browser window from /index.html to / but the link benefit/Google rankings will be redirected (like a 301 redirect without the browser redirecting).
You can set a relevant canonical URL for any page that can be loaded two or more ways. If you have dynamic pages for example that can be loaded in different ways look into canonical URLs. I use WordPress for most of my sites now and canonical URL support is built in (automated).
David Law
301 Redirect index.html to Root
Understanding Canonical URLs
Thanks for writing this article – I have been searching for days and not understanding Canonical problems at all. After reading this article and comments I managed to solve the two issue I had in 5 minutes :)
How Do 301 Redirects Work?
If I use this redirect does it all happen in the background or should I see the effect in my browser – when I type in non www my domain – my web site still comes up like that – ie it doesnt appear to redirect to the www version. thanks
How Do 301 Redirects Work?
How 301 Redirects Work
When a 301 redirect loads in a browser window you ‘see’ it redirect.
If you use the non www redirecting to the www and you loaded http://example.com/ it would immediately reload (redirect) to http://www.example.com/
If that doesn’t occur you’ve probably made a mistake. Refresh the page a few times (CTRL F5) to make sure you aren’t loading an old cache if this is a new 301 redirect.
David Law
How 301 Redirects Work
How to Make My Website Show up on Google First
hi this i need to everyone dat my website disappeared from google
n from whatever i read above i got dat this happens only when i did non-www redirect to www redirect in .htaccess file
and now websites index page is no where, can anyone suggest me wat to do
well i need some suggestion urgently, as it has completely lost the traffic on my website n my website used to b at first on SERPs for many keywords
PLSSSSSSS!!!!!!! …………. HELP
How to Make My Website Show up on Google First
Paid SEO Help for my Website
Hi, when I search for site:http://mydomain.com and even I searched for site:http://www.mydomain.com I didn’t get any result.
Google says did not match any documents.
im newbie i donno anything about SEO, i need professional SEO help, i can pay them.
if any one around pls contact me.
Htaccess 301 Redirect Code?
I. Am. Lost. Please help!
I created a .htaccess document and place it in my root folder. I am trying to accomplish two things.
1, get rid of the .html at the end of every page
2, redirect from www to non www.
3, redirect index.com to the root directory.
I haven’t been able to accomplish any of those things.
Here is my code:
Can someone please help me figure this out?
Thanks!
Htaccess 301 Redirect Code?
301 Redirects Causing a Loop
This code:
Will cause a loop.
You are saying via DirectoryIndex that index.html is the home page if it exists, then redirecting index.html to root which will look for index.html which will redirect to root which is index.html which will redirect to root…..
Easy solution to this would be to remove the 301 redirect of index.html and add a canonical URL to the index.html file:
When http://www.example.com/index.html is respidered the major search engines should only index / not /index.html and pass on any link benefit of links to /index.html
A canonical URL is like a ‘soft’ 301 redirect.
David Law
301 Redirects Causing a Loop