CodeIgniter Forums
index.php duplicate content - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: index.php duplicate content (/showthread.php?tid=53898)



index.php duplicate content - El Forum - 08-13-2012

[eluser]Unknown[/eluser]
Hello,

I need some help in redirecting http://[MySite]/index.php to http://[MySite]/
I don't want to have index.php as a page to prevent duplicate content.

I've tried what was suggested on: http://ellislab.com/forums/viewthread/132758/
but then I get redirect loop and the site wont load

Any suggestions?

Thanks
Ram


index.php duplicate content - El Forum - 08-13-2012

[eluser]CroNiX[/eluser]
Simple, never link to index.php (just link to your base url for home page) and no search engine will know it exists, so there won't be any duplicate content.

It doesn't matter if two URLs can show the same content if there are only links available for one of them.


index.php duplicate content - El Forum - 08-13-2012

[eluser]Egill Th[/eluser]
[quote author="rammukmel" date="1344892638"]Hello,

I need some help in redirecting http://[MySite]/index.php to http://[MySite]/
I don't want to have index.php as a page to prevent duplicate content.

I've tried what was suggested on: http://ellislab.com/forums/viewthread/132758/
but then I get redirect loop and the site wont load

Any suggestions?

Thanks
Ram[/quote]

Enable mod_rewrite and add a .htaccess file to the directory that contains your front controller. (index.php)

Code:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>