SMF Support > SMF 2.0.x Support

Redirect index.php to root does not work

<< < (2/4) > >>

James---:

--- Quote ---The way SMF works requires you to use index.php.
--- End quote ---

Really? Ah yes, I know exactly what you mean!

Because I can recall now that all the URLs and Boards
at the forum has /index.php?board=xx in the URL's.

That's pity because the /index.php is a duplicate version of the root page of the forum.
Duplicate content.

Do I have to open index.template.php in my Themes folder to put a canonical version to the root page
in the index.php file? Or can this be done with a mod? It seems that smfpacks seo mod does the trick?

Edit: i'm going to respond later to all the other comments. Thanks!

Arantor:

--- Quote ---Do I have to open index.template.php in my Themes folder to put a canonical version to the root page
in the index.php file?
--- End quote ---

SMF puts canonical URLs in itself. Including for / to /index.php

If you actually needed to do anything, redirecting from / to /index.php would be better but since it will work as expected without doing that (because SMF putting in canonical URLs fixes that) you don't need to do anything.

novill:
I use htaccess, try this


--- Code: ---RewriteEngine on
rewritecond %{http_host} ^www.myforum.com [nc]
rewriterule ^(.*)$ http://myforum.com/$1 [r=301,nc]
RewriteCond %{REQUEST_URI}  ^/index\.php$
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^index\.php$ http://myforum.com/ [R=301,L]
--- End code ---

Arantor:
That will slow your site down because every SMF generated URL will have index.php in it so every single link has to go through a redirect, and it will actually be penalised in Google for speed as a result.

Colin:
Is there some specific reason why you don't want to show index.php?.....

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version