Welcome to WebmasterWorld Guest from 54.224.230.193

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

301 from index.php to index.html

     
7:42 am on Aug 29, 2013 (gmt 0)

Moderator from US 

WebmasterWorld Administrator keyplyr is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Sept 26, 2001
posts:6536
votes: 114


Using linux/apache on shared hosting.

Been seeing dozens of 404s in logs due to various requests for index.php (I use index.html.) I would think the server config would automatically correct these requests, but I guess not. I do use a nice, friendly 404 error page with site navigation, but many* still leave the site after not getting what they expected.

I'm currently testing: Redirect 301 /index.php http://www.example.com/

Working well, no more 404s. The question is... anything I'm not considering? For example: duplicate content?


*While some requests are from bad agents & vulnerability checks, there are legit user requests requesting index.php.

[edited by: keyplyr at 8:00 am (utc) on Aug 29, 2013]

7:59 am on Aug 29, 2013 (gmt 0)

Administrator

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Aug 10, 2004
posts:10553
votes: 13


if you are using any mod_rewrite directives (RewriteRule) in your .htaccess or server config, you should also use mod_rewrite (instead of mod_alias) for this redirect.

for example, to do a proper canonical hostname redirect, you'll need to use mod_rewrite.


see relevant discussion in this recent Apache Web Server forum thread - Redirect with wildcard not working:
http://www.webmasterworld.com/apache/4604076.htm [webmasterworld.com]
8:05 am on Aug 29, 2013 (gmt 0)

Moderator from US 

WebmasterWorld Administrator keyplyr is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Sept 26, 2001
posts:6536
votes: 114


Not internal. No mod_rewrite.
8:14 am on Aug 29, 2013 (gmt 0)

Administrator

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Aug 10, 2004
posts:10553
votes: 13


no canonical hostname redirect?
8:30 am on Aug 29, 2013 (gmt 0)

Moderator from US 

WebmasterWorld Administrator keyplyr is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Sept 26, 2001
posts:6536
votes: 114


no.

Thanks. I got the admin to redirect at the server. Problem solved.
10:35 am on Aug 29, 2013 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
posts:13210
votes: 347


would think the server config would automatically correct these requests

Nothing is automatic. If you're on shared hosting, some things may seem to happen magically. But it's only because the host has set it up that way to forestall common problems.
5:28 pm on Aug 29, 2013 (gmt 0)

Moderator from US 

WebmasterWorld Administrator keyplyr is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Sept 26, 2001
posts:6536
votes: 114


Ya don't say