Ad

Getting "mywebsite.org/" To Resolve To "mywebsite.org/index.php"

At my work we have various web pages that, my boss feels, are being ranked lower than they should be because "mywebsite.org/category/" looks like a different URL to search engines than "mywebsite.org/category/index.php" does, even though they show the same file. I don't think it works this way but he's convinced. Maybe I'm wrong though. I have two questions:

  1. How do i make it so that it will say "index.php" in the address bar of all subcategories?
  2. Is this really how pagerank works?
Ad

Answer

  1. Besides changing all the links everywhere, a simpler solution is to use a rewrite rule. Make sure it is a permanent redirect, or Google will keep using the old link (without index.php). How you do this exactly depends on your web server, but for Apache HTTPd it looks something like the example given below.
  2. Yes. Or so I've heard. Very few people know for sure. But Google mentions this guideline (as "Be consistent"). Make sure to check out all of Google's Webmaster guidelines.

Apache config for rewrite rule:

# in the generic config
LoadModule rewrite_module modules/mod_rewrite.so

# in your virutal host
RewriteEngine On

# redirect everything that ends in a slash to the same, but with index.php added
RewriteRule ^(.*)/$ $1/index.php [R=301,L]

# or the other way around, as suggested
# RewriteRule ^(.*)/index.php$ $1/ [R=301,L]
Ad
source: stackoverflow.com
Ad