Solved

SEO: Using .htaccess to redirect www-root directory to www/home/

Posted on 2007-11-25
3
693 Views
Last Modified: 2012-06-27
I want to know if the following is terrible or not with respect to SEO:

I have a small-site, structured in a pretty standard way: each page has its own directory off of the www root directory. I have a navigation bar file (located at the www root) that I include via php-includes on each page. My directory structure makes the nav-bar's references nice and simple. I have these pages:
www/home/index.php
www/about/index.php
www/contact/index.php

My nav-bar file looks like this:
<a href="../home/index.php">Home</a>
<a href="../about/index.php">About</a>
<a href="../contact/index.php">Contact Us</a>

Then I just use a <?php include("../navBar.php"); ?> statement on each page to include my nav-bar.

But when someone navigates to http://www.mydomain.com/ , I need them to end up at www/home/index.php. So, at the root of the site (ie, the www directory), I have a .htaccess file that redirects to the home directory via the following line:
DirectoryIndex ./home/index.php

So what are the implications of that design with respect to search-engine friendliness?
0
Comment
Question by:Melvinivitch
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 33

Expert Comment

by:humeniuk
ID: 20345884
In terms of SEO, the proper way to do it is to make sure that you are using a permanent/301 redirect to redirect to your desired home directory/page.
0
 

Author Comment

by:Melvinivitch
ID: 20345986
Ok, I'll do that.

Just curious, though - what are the ramifications of doing it the way I outlined above?
0
 
LVL 33

Accepted Solution

by:
humeniuk earned 500 total points
ID: 20346369
The purpose of the permanent redirect is to pass the value of incoming links to the destination page - incoming links are one of the most important ranking factors for the major search engines.  A permanent redirect - one that returns a 301 http code - is the most reliable way to do this.

If you do not specify, then it is regarded as a temporary (302) redirect and the search engines are less inclined to pass the value of those links to a temporary redirection/page.  Having said that, the SE's have gotten better at recognizing long term 302's as being essentially the same as 301's, but it's better to do it right from the beginning.
0

Featured Post

Containers and Docker for Everyone

Containers are an incredibly powerful technology that can provide you and/or your engineering team with huge productivity gains. Using containers, you can deploy, back up, replicate, and move apps and their dependencies quickly and easily.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SEO can be a real minefield to navigate, but there are three simple ways to up your SEO game just be re-assessing your content output.
Starting your own business is always a daunting process, and for most people it is brand new experience. Avoid the common pitfalls by following these tips to start on the road to success.
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn how to dynamically set the form action using jQuery.

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question