MyBB Community Forums

Full Version: How to redirect mysite.com/index.php to mysite.com?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
If I click the forum logo in the top it takes it to site.com/index.php

Should I redirect it to site.com ?
Change the link.

Template: Header Templates > header

Change:
<div class="logo"><a href="{$mybb->settings['bburl']}/index.php"><img src="{$theme['logo']}" alt="{$mybb->settings['bbname']}" title="{$mybb->settings['bbname']}" /></a></div>

To:
<div class="logo"><a href="{$mybb->settings['bburl']}"><img src="{$theme['logo']}" alt="{$mybb->settings['bbname']}" title="{$mybb->settings['bbname']}" /></a></div>
effone thanks but at least index.php will still exist in Google's index as duplicate url.

I've added in the .htaccess in the bottom of mod_rewrite:

Quote: RewriteRule ^index\.php(.*)$ http://%{HTTP_HOST}$1 [L,R=301]

And it seems to be working fine ...
Google is intelligent enough to know that index.php is a directory index, no need to worry about redirects.
No but I'm sure it does not care about index.php in itself.