MyBB Community Forums

Full Version: Search engines duplicating homepage
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
I see that search engines have picked up my forum with AND without the /index.php . How/where can I get this set up so that search engines know that the two are the same. I'd certainly prefer (if I can choose) that they show www.mydomain.com rather than www.mydomain.com/index.php .
One place I see the problem is that my forum logo (upper left of every screen) is linked to /index.php - in what template can I change that link? Or do I do this in .htaccess?
Thanks so much!
Heart
Sharon
You can change where the logo links to in the header template.
you can also redirect index.php to / in your .htaccess, and/or add a canonical tag to your index template
(2009-11-07, 01:51 AM)frostschutz Wrote: [ -> ]you can also redirect index.php to / in your .htaccess, and/or add a canonical tag to your index template
I'd really like to do it in .htaccess because i think it's the surest way to get it right. I also dont like the non-www version issue, so I already have that being handled in .htaccess .
RewriteEngine on
RewriteBase /
rewritecond %{http_host} ^mydomain.com [nc]
rewriterule ^(.*)$ http://www.mydomain.com/$1 [r=301,nc] 
RewriteRule ^sitemap-([^./]+)\.xml$ misc.php?google_seo_sitemap=$1 [L,QSA,NC]
So what would the syntax be for index.php to / ? Would I put it just above your google_seo_sitemap rewriterule?
(2009-11-06, 08:41 PM)MattRogowski Wrote: [ -> ]You can change where the logo links to in the header template.
Thank you Matt... done Smile
RewriteRule ^index\.php$ http://www.mydomain.com/ [L,QSA,R=301]
THANK YOU THANK YOU!! Wink
Huh Error received using Firefox when I tried to test it by typing in the url www.com-pres-sions-tock-inginfo.com/index.php (I inserted hyphens in the domain names to avoid SE's indexing my url in this thread):
The page isn't redirecting properly

Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

Here's the whole .htaccess:
RewriteEngine on
RewriteBase /
rewritecond %{http_host} ^com-pres-sions-toc-kinginfo.com [nc]
rewriterule ^(.*)$ http://www.co-mpre-ssio-nstoc-kinginfo.com/$1 [r=301,nc]
RewriteRule ^index\.php$ http://www.comp-ress-ions-tockin-ginfo.com/ [L,QSA,R=301]
RewriteRule ^sitemap-([^./]+)\.xml$ misc.php?google_seo_sitemap=$1 [L,QSA,NC]
RewriteRule ^Forum-([^./]+)$ forumdisplay.php?google_seo_forum=$1 [L,QSA,NC]
RewriteRule ^Thread-([^./]+)$ showthread.php?google_seo_thread=$1 [L,QSA,NC]
RewriteRule ^Announcement-([^./]+)$ announcements.php?google_seo_announcement=$1 [L,QSA,NC]
RewriteRule ^User-([^./]+)$ member.php?action=profile&google_seo_user=$1 [L,QSA,NC]
RewriteRule ^Calendar-([^./]+)$ calendar.php?google_seo_calendar=$1 [L,QSA,NC]
RewriteRule ^Event-([^./]+)$ calendar.php?action=event&google_seo_event=$1 [L,QSA,NC]
ErrorDocument 404 /misc.php?google_seo_error=404
try adding
RewriteCond %{IS_SUBREQ} false
before the index redirect rule
(2009-11-07, 03:43 AM)frostschutz Wrote: [ -> ]try adding
RewriteCond %{IS_SUBREQ} false
before the index redirect rule
Nope. Still same error. Sad
Dunno why .htaccess isnt working as it should, so I reverted back to how it was, but I changed the link in the header logo (removed the index.php) and added to index:
<link rel="canonical" href="http://www.com-pr-essi-onst-ockin-ginfo.com" />
I dont think there are any other references to index.php in the board's links, so this should be fine now.

Matt & Frostschutz... thanks again and again for all your assistance! So much appreciated!