Welcome to WebmasterWorld Guest from 54.160.131.144

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

301 from index.php to index.html

     

keyplyr

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

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



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]

phranque

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

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



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]

keyplyr

8:05 am on Aug 29, 2013 (gmt 0)

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



Not internal. No mod_rewrite.

phranque

8:14 am on Aug 29, 2013 (gmt 0)

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



no canonical hostname redirect?

keyplyr

8:30 am on Aug 29, 2013 (gmt 0)

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



no.

Thanks. I got the admin to redirect at the server. Problem solved.

lucy24

10:35 am on Aug 29, 2013 (gmt 0)

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



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.

keyplyr

5:28 pm on Aug 29, 2013 (gmt 0)

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



Ya don't say