Solved

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

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
In this blog, I will share you some basic tips for content marketing and to rank your website on Google.
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

805 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