The homepage for a drupal site can be reached both ways causing a possible duplicate content issue:

drupalsite.com/index.php
drupalsite.com

There were previous discussions of this issue, but I guess this should become core:
http://drupal.org/node/12956

Comments

giorgio79’s picture

Sorry, correct link to discussion: http://drupal.org/node/129561

gpk’s picture

Component: path.module » base system

Visitors will only attempt to view example.com/index.php if for some reason they manually type in that URL, or if you or someone else has linked to the site using that URL. I can't imagine it's likely to be a problem in most cases. All links on the home page will have the index.php omitted.

The recommended fix for this would probably be a suitable .htaccess directive, but not the one in the discussion you reference which, as noted, won't work. Note that some servers (e.g those running IIS) may actually run the whole site off URLs of the form example.com/index.php?q=node/123 so this issue may actually be a clear "won't fix".

However you might want to post this request to the http://drupal.org/project/globalredirect issue queue since it might be possible to fix it there (and have a switch for this behavior in the admin interface).

giorgio79’s picture

Status: Closed (duplicate) » Active

Thanks posted, it to Global Redirect as well, let's see what they say

#581152: drupalsite.com/index.php should redirect drupalsite.com

traviscarden’s picture

I'm sure it's true that sites originally built in Drupal will not be much afflicted with this problem, but I get a surprising number of clients whose legacy systems suffer from the problem—especially "homegrown" PHP solutions. The problem such sites bring with them is inbound links to /index.php. Google Analytics tells me that a client of mine I just moved to Drupal is still getting more traffic to /index.php than any other page, presumably for that reason. I added a couple of lines to my .htaccess file to fix it, but it caused all of IE 6, 7, and 8 to choke on every non-front page request. (Of course, all of Firefox, Safari, Chrome, and Opera handled it just fine.) The code I added follows:

RewriteRule ^index.php$ / [R=301]

I placed this before # Rewrite URLs of the form 'x' to the form 'index.php?q=x'.. (Placing it after the following rules causes an infinite redirect loop.) I wonder, if there are any MOD_REWRITE wizards out there that could get this to work with IE, if we could still get this in core, rather than in a contrib module (if that proves advisable and the community so chooses).

traviscarden’s picture

This feature has been implemented in the latest dev version of Global Redirect: http://drupal.org/project/cvs/88008

giorgio79’s picture

Status: Active » Closed (duplicate)

Status: Active » Closed (duplicate)