?
Solved

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

Posted on 2007-11-25
3
Medium Priority
?
704 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 2000 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

Eye-catchers on the conference table

Challenge: The i-unit group was not satisfied with the audio quality during remote meetings. They were looking for a portable solution with excellent audio quality for use in their conference room but also at their client’s offices.

Question has a verified solution.

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

Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
Read on to get a few ideas on how to promote your next corporate event.
The viewer will learn how to dynamically set the form action using jQuery.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
Suggested Courses
Course of the Month15 days, 1 hour left to enroll

840 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