SEO + PHP header command, oh and 301 redirects

by TTYd
3 replies
  • SEO
  • |
Hi all, I've started to question something I've been taking for granted, and wanted to ask you guys what you think cause I'm a little out of my depth.

I'm friends with a guy at one of the main UK design companys, and a year ago he showed me how they go about building sites. Because the info is from such a big company, I assumed it was the best way of doing it.

Every page on a site they create is called index.php and has its own folder (Home, Contact, etc) and all css/js/img/etc are stored in /a/img, /a/css, /a/js etc.

The root index.php file is as follows;

<?php
header( 'Location: Home/' ) ;
?>

My first question is whether the above code is bad for SEO - should the root index.php have the actual content on it without relying on 'header' to pull it in?

My second question - is this just is a bad way of doing things? I end up with site paths such as "example.com/Bricks", but would it be better for SEO if, instead of having 30 index.php files, I had 30 unique keyword relevant filenames instead? "example.com/Bricks/bricks.ph p" for example.

My third question... well, I screwed up somehow and I don't remember doing it (afaik I've never even used a 301 redirect before), but the index.php on one of my sites got overwritten so that instead of using 'header' to pull in the raw header of /Home/, I had a 301 perm redirect command in there, pointing to /Home/. So the question is, exactly how permanent is a 301, and how do I fix this? I've replaced the 301 with a PHP Header, done a googlebot crawl on WMT and resubmitted - is this enough? Or, do I go down the path of putting in a 301 on /Home to point to /index.php and have all the home content straight in that one file?

Thanks in advance!

(I previously posted in the wrong forum, sorry about that!)
#301 #command #header #php #redirects #seo
  • Profile picture of the author Above
    I would use .htaccess instead of redirects to accomplish what I think you are looking for
    {{ DiscussionBoard.errors[4630396].message }}
    • Profile picture of the author TTYd
      Ahh that's a good point, I'll have a go at seeing how that would look.

      How about the 301 mess? Should I just wait it out before making any changes?
      {{ DiscussionBoard.errors[4634393].message }}
  • Profile picture of the author TTYd
    In the end I changed /index.php so it contained the content previously in /Home, and put a 301 in /Home/index.php > /index.php. After a month it sorted itself out and everything is currently looking good.
    {{ DiscussionBoard.errors[6325037].message }}

Trending Topics