Solved

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

Posted on 2007-11-25
3
684 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
  • 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

"In order to have an organized way for empathy mapping, we rely on a psychological model and trying to model it in a simple way, so we will split the board to three section for each persona and a scenario and try to see what those personas would Do,…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn how to count occurrences of each item in an array.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

708 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now